changed sprintf to more secure snprintf to prevent vulnerability to buffer

overflow exploits.
This commit is contained in:
Ed Beroset 2004-12-15 17:10:25 +00:00
parent 19f927ac64
commit 83b2809a03

2
nasm.c
View file

@ -185,7 +185,7 @@ int main(int argc, char **argv)
/* define some macros dependent of command-line */
{
char temp [64];
sprintf (temp, "__OUTPUT_FORMAT__=%s\n", ofmt->shortname);
snprintf (temp, sizeof(temp), "__OUTPUT_FORMAT__=%s\n", ofmt->shortname);
pp_pre_define (temp);
}