]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: avoid out-of-bounds read in literals
authorDaiki Ueno <ueno@gnu.org>
Wed, 24 Jun 2015 14:23:22 +0000 (23:23 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 24 Jun 2015 14:23:22 +0000 (23:23 +0900)
* gettext-tools/src/x-c.c (literalstring_parse): Check if the next
character of a backslash is NUL.  Reported by Hanno Boeck in:
<http://savannah.gnu.org/bugs/?45391>.

gettext-tools/src/ChangeLog
gettext-tools/src/x-c.c

index 9974a1c5c2b5677b66b8d3f8f3f64e5772771cf8..0b7dbe10a3a52b32a5b09ae3e8535620cae85c18 100644 (file)
@@ -1,3 +1,10 @@
+2015-06-24  Daiki Ueno  <ueno@gnu.org>
+
+       * x-c.c (literalstring_parse): Check if the next character of a
+       backslash is NUL.
+       Reported by Hanno Boeck in:
+       <http://savannah.gnu.org/bugs/?45391>.
+
 2015-06-23  Daiki Ueno  <ueno@gnu.org>
 
        * cldr-plurals.c (main): Fix unmatched braces when
index b5bc7b079cf75501e7b15f321fd5b06941dcb163..f6922f8fdc6a0f411dc861b5d4fc4343584d37d5 100644 (file)
@@ -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)