Bash crash in iswprint while running haikuporter
|Reported by:||pulkomandy||Owned by:||zooey|
Description (last modified by )
bash crashes when parsing recipes which have unicode characters (in the case of album, in the copyright). This was apparently introduced when outsourcing bash.
There is no gLocaleRoster in this case, and iswprint tries to use the 384-entries flag table for the unicode char, but this results in an out of range access for any non-ASCII char.
So there are two bugs:
- gLocaleRoster shouldn't be NULL (I have tried reproducing the issue out of HaikuPorter, and indeed it isn't NULL in that case)
- The functions should not crash when gLocaleRoster is NULL and they are fed an unicode character.
One way to fix the latter is to add bounds checks to
__isctype and always return false for out of range characters. But I think it's better to investigate the first issue first.