summaryrefslogtreecommitdiff
path: root/preproc.c
diff options
context:
space:
mode:
authorEd Beroset <beroset@mindspring.com>2004-12-15 18:30:54 +0000
committerEd Beroset <beroset@mindspring.com>2004-12-15 18:30:54 +0000
commit3ef4e4da041951827359396b95f46c5631b20fcc (patch)
tree02cec3a91b9df74ac6429ffad226212e6f8d7b05 /preproc.c
parent9234817aa44ba7436ea51c556f3aeca316f28ae7 (diff)
downloadnasm-3ef4e4da041951827359396b95f46c5631b20fcc.tar.gz
nasm-3ef4e4da041951827359396b95f46c5631b20fcc.tar.bz2
nasm-3ef4e4da041951827359396b95f46c5631b20fcc.zip
changed last sprintf to more secure snprintf to prevent vulnerability to buffer
overflow exploits.
Diffstat (limited to 'preproc.c')
-rw-r--r--preproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/preproc.c b/preproc.c
index eb062b4..dbcd88d 100644
--- a/preproc.c
+++ b/preproc.c
@@ -528,7 +528,7 @@ prepreproc(char *line)
fname++;
fnlen = strcspn(fname, "\"");
line = nasm_malloc(20 + fnlen);
- sprintf(line, "%%line %d %.*s", lineno, fnlen, fname);
+ snprintf(line, 20+fnlen,"%%line %d %.*s", lineno, fnlen, fname);
nasm_free(oldline);
}
if (tasm_compatible_mode)