summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorHanno Boeck <hanno@gentoo.org>2016-03-26 04:10:15 +0900
committerDaiki Ueno <ueno@gnu.org>2016-03-26 04:17:40 +0900
commit0571be87e09c6db11be8c56c773b563c2b4c99a4 (patch)
treeb10939c5b6c4994d0f9c032f00220a7bc12a71ae /gettext-tools
parentb4220c509a90186931a69575981c1b0e80ffc1f6 (diff)
downloadexternal_gettext-0571be87e09c6db11be8c56c773b563c2b4c99a4.zip
external_gettext-0571be87e09c6db11be8c56c773b563c2b4c99a4.tar.gz
external_gettext-0571be87e09c6db11be8c56c773b563c2b4c99a4.tar.bz2
lua: Avoid heap buffer overflow
* gettext-tools/src/x-lua.c (string_end): Allocate a room for terminating NUL. Reported in: http://savannah.gnu.org/bugs/?4753 Copyright-paperwork-exempt: yes
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/src/x-lua.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gettext-tools/src/x-lua.c b/gettext-tools/src/x-lua.c
index 0399c49..78ac24f 100644
--- a/gettext-tools/src/x-lua.c
+++ b/gettext-tools/src/x-lua.c
@@ -451,6 +451,12 @@ string_add (int c)
static void
string_end ()
{
+ if (string_buf_length >= string_buf_alloc)
+ {
+ string_buf_alloc = string_buf_alloc + 1;
+ string_buf = xrealloc (string_buf, string_buf_alloc);
+ }
+
string_buf[string_buf_length] = '\0';
}