From 83b2809a03743310b4f44ab2d135776708ee9b25 Mon Sep 17 00:00:00 2001 From: Ed Beroset Date: Wed, 15 Dec 2004 17:10:25 +0000 Subject: [PATCH] changed sprintf to more secure snprintf to prevent vulnerability to buffer overflow exploits. --- nasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nasm.c b/nasm.c index e6be9256..07fe30a6 100644 --- a/nasm.c +++ b/nasm.c @@ -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); }