bug+patch for locateInStringList (physfs 1.1.0)

Matze Braun matze at braunis.de
Sun Sep 11 13:19:45 EDT 2005


The locateInStringList function from physfs 1.1.0 contains a bug:
if the string we search is greater than all elements in a list, then
"lo" will become hi+1 and exceeds the limits of the list. This bug is
quiet severe as it makes physfs randomly crash when
PHYSFS_enumerateFiles is used.

I adapted the algorithm from STL std::lower_bound to work in physfs.
This makes the code correct and a bit cleaner. A patch is attached to
this e-mail.

I hope you can soon find the time to release a new version of physfs!


-------------- next part --------------
A non-text attachment was scrubbed...
Name: physfs_binary_search_fix.patch
Type: text/x-patch
Size: 2002 bytes
Desc: not available
URL: <http://icculus.org/pipermail/physfs/attachments/20050911/d4dfa244/attachment.bin>

More information about the physfs mailing list