]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
vala: Fix empty string literal handling
authorDaiki Ueno <ueno@gnu.org>
Mon, 14 Jul 2014 02:55:01 +0000 (11:55 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 14 Jul 2014 02:58:28 +0000 (11:58 +0900)
Similar to the commit 7b2d8d61 on July 11.
* x-vala.c (phase3_get): Add missing memory allocation for empty
string literal.

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

index c68deb578d7c654392c1ad548548e37967d6dabc..c0826b782e699cafda36c735eaeeb3811ca5d446 100644 (file)
@@ -1,3 +1,10 @@
+2014-07-14  Daiki Ueno  <ueno@gnu.org>
+
+       vala: Fix empty string literal handling
+       Similar to the commit 7b2d8d61 on July 11.
+       * x-vala.c (phase3_get): Add missing memory allocation for empty
+       string literal.
+
 2014-07-14  Daiki Ueno  <ueno@gnu.org>
 
        build: Fix race in post-install removal of *.a
index 288f9b7f51883a133e2e5f6d359d1dbeeafa914c..b88b220f36c8b2ad9ff3cd5aebf2aaa3a8a4794d 100644 (file)
@@ -764,6 +764,11 @@ phase3_get (token_ty *tp)
                     break;
                   }
               }
+            if (bufpos >= bufmax)
+              {
+                bufmax = 2 * bufmax + 10;
+                buffer = xrealloc (buffer, bufmax);
+              }
             buffer[bufpos] = 0;
             tp->type = last_token_type = template
               ? token_type_string_template : token_type_string_literal;