From 8d2352554f8628c59b080b061df61cbe4947b83e Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 24 Jun 2015 23:23:22 +0900 Subject: 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: . --- gettext-tools/src/ChangeLog | 7 +++++++ gettext-tools/src/x-c.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 9974a1c..0b7dbe1 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 b5bc7b0..f6922f8 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) -- cgit v1.1