I see the same crash with current upstream. The difference is that the buffer is returned by "GUTF8String::getbuf()" and not "GStringRep::getbuf()" this time.
Since I don't see a way how to create a 0-sized string with current API of "GStringRep::UTF8" (it always returns NULL) I just check the returned buffer for NULL just before the "buffer[readsize] = 0;" in "DjVuTXT::decode()" and it does not crash.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
crash input
Fixed by https://sourceforge.net/p/djvu/djvulibre-git/ci/7b0ef20690e08f1fe124aebbf42f6310e2f40f81/.
Thanks.
Hi,
I see the same crash with current upstream. The difference is that the buffer is returned by "GUTF8String::getbuf()" and not "GStringRep::getbuf()" this time.
Since I don't see a way how to create a 0-sized string with current API of "GStringRep::UTF8" (it always returns NULL) I just check the returned buffer for NULL just before the "buffer[readsize] = 0;" in "DjVuTXT::decode()" and it does not crash.