Follow-up Comment #1, bug #47991 (project gettext): I think I see what happened. Value is getting set to a position in buffer at read-desktop.c:431, but APPEND is called after that, which reallocs buffer and invalidates that pointer. Here's a possible patch:
diff --git a/gettext-tools/src/read-desktop.c b/gettext-tools/src/read-desktop.c index 417c08a..c5a9b08 100644 --- a/gettext-tools/src/read-desktop.c +++ b/gettext-tools/src/read-desktop.c @@ -327,7 +327,7 @@ desktop_lex (token_ty *tp) case '5': case '6': case '7': case '8': case '9': { const char *locale = NULL; - const char *value = NULL; + size_t value_start = 0; for (;;) { APPEND (c); @@ -428,7 +428,7 @@ desktop_lex (token_ty *tp) break; } - value = &buffer[bufpos]; + value_start = bufpos; for (;;) { c = phase2_getc (); @@ -440,7 +440,7 @@ desktop_lex (token_ty *tp) tp->type = token_type_pair; tp->string = xmemdup (buffer, bufpos); tp->locale = locale; - tp->value = value; + tp->value = &buffer[value_start]; return; } default: _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?47991> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/