New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
valgrind: unicode_utf8_trim #608
Comments
Das Schiff hat einen Fehler im Namen, da sind zwei aufeinander folgende bytes -61 und 0, was mal ein ü war, aber der Name wurde wohl irgendwie zerstört? Jedenfalls liest der Code jetzt über die terminierende 0 weg, weil das Byte davor das UTF8 Fortsetzungsbit gesetzt hat. Das ist z.B. so bei Schiff Nummer 3476(dec), in Datenfile 961. |
I suspect that unicode_utf8_to_ucs4 does not handle zero bytes correctly. Or any badly formed UTF8, for that matter. |
Der String im Datenfile ist 127 Zeichen lang: "Das stolze Drachenschiff wurde Ragna von ihrer Mutter geschenkt. Seitdem kreuzt es über die Meere und hat bisher jeden Sturm " |
Das klingt beinahe, als wäre der von einem Tool (falsch) beschnitten worden. |
Oh, spannend. Das scheint ganz anders zu sein. Das zero-byte gehört da wohl nicht hin. Im alten Code, der die Bytefolge einfach behalten hat, kommt folgendes im CR raus:
Die beiden kaputten Bytes hier sind also c3 bc. |
Gehört der Partei "The Cult of the Sahuagin" |
Das Byte C3 am Ende des Strings ist falsch. Danach müsste eigentlich noch ein weiteres Byte kommen. Tut es aber nicht, und unicode_utf8_to_ucs4 liest statt dessen den nul-Terminator, den bin_r_str_buf ans Ende gesetzt hat, obwohl der String eigentlich zu Ende ist. |
Conditional jump or move depends on uninitialised value(s)
at 0x4F5D5A: unicode_utf8_trim (unicode.c:39)
by 0x4DA8BF: read_ship (save.c:1589)
by 0x4DAE75: read_game (save.c:1707)
by 0x4DA255: readgame (save.c:1500)
by 0x423CDF: eressea_read_game (bind_eressea.c:22)
by 0x4208E4: tolua_eressea_eressea_read_game00 (eressea.pkg.c:70)
by 0x4E3C471: ??? (in /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0)
by 0x4E479B6: ??? (in /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0)
by 0x4E3C6B8: ??? (in /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0)
by 0x4E38860: lua_callk (in /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0)
by 0x4E4B9B7: ??? (in /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0)
by 0x4E3C471: ??? (in /usr/lib/x86_64-linux-gnu/liblua5.2.so.0.0.0)
The text was updated successfully, but these errors were encountered: