From: Daiki Ueno Date: Wed, 24 Jun 2015 14:23:22 +0000 (+0900) Subject: xgettext: avoid out-of-bounds read in literals X-Git-Tag: v0.19.5~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d2352554f8628c59b080b061df61cbe4947b83e;p=thirdparty%2Fgettext.git xgettext: avoid out-of-bounds read in literals * gettext-tools/src/x-c.c (literalstring_parse): Check if the next character of a backslash is NUL. Reported by Hanno Boeck in: . --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 9974a1c5c..0b7dbe10a 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2015-06-24 Daiki Ueno + + * x-c.c (literalstring_parse): Check if the next character of a + backslash is NUL. + Reported by Hanno Boeck in: + . + 2015-06-23 Daiki Ueno * cldr-plurals.c (main): Fix unmatched braces when diff --git a/gettext-tools/src/x-c.c b/gettext-tools/src/x-c.c index b5bc7b079..f6922f8fd 100644 --- a/gettext-tools/src/x-c.c +++ b/gettext-tools/src/x-c.c @@ -1002,6 +1002,8 @@ literalstring_parse (const char *string, lex_pos_ty *pos, } c = *++p; + if (c == '\0') + break; if (type & LET_ANSI_C) switch (c)