diff options
author | bosk <> | 2010-07-16 13:01:15 +0000 |
---|---|---|
committer | bosk <> | 2010-07-16 13:01:15 +0000 |
commit | efdcd3809052144ecc90c1c07a0f9f93d09c1870 (patch) | |
tree | ecb55e4fbe235896bc41a2eae80de9814856c0cd | |
parent | 77556f1d93574ad38c11b1dbe47027c509c6c0a4 (diff) | |
download | make-efdcd3809052144ecc90c1c07a0f9f93d09c1870.tar.gz |
Fix buffer overrun in concat().
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | misc.c | 8 |
2 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,7 @@ +2010-07-16 Boris Kolpackov <boris@codesynthesis.com> + + * misc.c (concat): Fix buffer overrun. + 2010-07-12 Paul Smith <psmith@gnu.org> Update copyrights to add 2010. @@ -202,6 +202,14 @@ concat (num, va_alist) VA_END (args); + /* Get some more memory if we don't have enough space for the + terminating '\0'. */ + if (ri == rlen) + { + rlen = (rlen ? rlen : 60) * 2; + result = xrealloc (result, rlen); + } + result[ri] = '\0'; return result; |