diff options
author | Hanno Boeck <hanno@gentoo.org> | 2016-03-26 04:10:15 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2016-03-26 04:17:40 +0900 |
commit | 0571be87e09c6db11be8c56c773b563c2b4c99a4 (patch) | |
tree | b10939c5b6c4994d0f9c032f00220a7bc12a71ae | |
parent | b4220c509a90186931a69575981c1b0e80ffc1f6 (diff) | |
download | external_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
-rw-r--r-- | gettext-tools/src/x-lua.c | 6 |
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'; } |