diff --git a/ChangeLog b/ChangeLog index 12ef1c4b..a4d06007 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-07-16 Boris Kolpackov + + * misc.c (concat): Fix buffer overrun. + 2010-07-12 Paul Smith Update copyrights to add 2010. diff --git a/misc.c b/misc.c index f4806acb..39c2835e 100644 --- a/misc.c +++ b/misc.c @@ -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;