nalgeon / sqlean

The ultimate set of SQLite extensions
MIT License
3.75k stars 120 forks source link

Do not allow zero-length VLAs in soundex library #58

Closed skeeto closed 1 year ago

skeeto commented 1 year ago

When the string is empty, the program creates a zero-length VLA which is undefined behavior. Instead, always allocate an extra byte as though accounting for the null terminator in the original string. This error is caught by UBSan while running the tests.

I did not take time to report this upstream (to @Rostepher) because it looks to be abandoned.