summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2010-01-14 08:10:35 +0000
committerPeter Johnson <peter@tortall.net>2010-01-14 08:10:35 +0000
commit26c7e747294895bf0f8b68bf064e4ca2b5cdf88a (patch)
treef87de36195b116444e7812e3696ade1ab7f65190
parente7185d2e24047e6af72911687f535562286a7fc5 (diff)
downloadyasm-26c7e747294895bf0f8b68bf064e4ca2b5cdf88a.tar.gz
substitute_values(): Allocate sufficient space for null terminator.
Noticed by: Alexei Svitkine svn path=/trunk/yasm/; revision=2274
-rw-r--r--modules/preprocs/gas/gas-preproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/preprocs/gas/gas-preproc.c b/modules/preprocs/gas/gas-preproc.c
index 0f659252..2fa7af9b 100644
--- a/modules/preprocs/gas/gas-preproc.c
+++ b/modules/preprocs/gas/gas-preproc.c
@@ -775,7 +775,7 @@ static void substitute_values(yasm_preproc_gas *pp, char *line)
line_length += delta;
if (delta > 0) {
- line = yasm_xrealloc(line, line_length);
+ line = yasm_xrealloc(line, line_length + 1);
for (k = line_length; k >= cursor; k--) {
line[k + delta] = line[k];
}