]> granicus.if.org Git - yasm/commitdiff
substitute_values(): Allocate sufficient space for null terminator.
authorPeter Johnson <peter@tortall.net>
Thu, 14 Jan 2010 08:10:35 +0000 (08:10 -0000)
committerPeter Johnson <peter@tortall.net>
Thu, 14 Jan 2010 08:10:35 +0000 (08:10 -0000)
Noticed by: Alexei Svitkine

svn path=/trunk/yasm/; revision=2274

modules/preprocs/gas/gas-preproc.c

index 0f659252a2b82e23352671a34d33f774299a3266..2fa7af9b89528f2d294d36efedc6f761b6c26eff 100644 (file)
@@ -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];
                     }