9

Fix a read head-buffer-overflow in esm

 3 years ago
source link: https://gitlab.com/OpenMW/openmw/-/merge_requests/751
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Fix a read head-buffer-overflow in esm

The check forgot to account for the terminal zero.

Request to merge jvoisin:fix_esm into master
Detached merge request pipeline #287992893 passed for a35eae3d 1 month ago
Approval is optional

Merged by 1 month ago (Apr 25, 2021 9:56pm GMT+0000) 1 month ago

The changes were merged into master with add04a4e

The source branch has been deleted

Pipeline #292027276 passed with warnings for add04a4e on master 1 month ago

This is probably ok, but I'm wondering if the overflow condition can't be made more clear/more high-level. Casting a pointer to a size_t is bad because the size of the pointer type is not necessarily the same as the size of size_t (though it doesn't matter in this case as there's no way the script variables table will be long enough to break the assumption). Never mind, I forgot it's not a pointer type that is the result of pointer substraction. Still...

Edited by Alexei Dobrohotov 1 month ago

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK