summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordavygrvy <davygrvy>2003-12-23 04:01:02 (GMT)
committerdavygrvy <davygrvy>2003-12-23 04:01:02 (GMT)
commitd3de706d17cb5e97867529862c334d9aa825bb4d (patch)
tree63e628da6f4ec6032da7cf87d31206b36d3b8b23 /win
parent8a2766860a03f66263b618162736fadf4862d328 (diff)
downloadtk-d3de706d17cb5e97867529862c334d9aa825bb4d.zip
tk-d3de706d17cb5e97867529862c334d9aa825bb4d.tar.gz
tk-d3de706d17cb5e97867529862c334d9aa825bb4d.tar.bz2
prevent static buffer overflow (Doh!)
Diffstat (limited to 'win')
-rw-r--r--win/nmakehlp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
index 54b3adc..06182ae 100644
--- a/win/nmakehlp.c
+++ b/win/nmakehlp.c
@@ -9,7 +9,7 @@
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* ----------------------------------------------------------------------------
- * RCS: @(#) $Id: nmakehlp.c,v 1.3 2003/12/23 03:52:45 davygrvy Exp $
+ * RCS: @(#) $Id: nmakehlp.c,v 1.4 2003/12/23 04:01:02 davygrvy Exp $
* ----------------------------------------------------------------------------
*/
#include <windows.h>
@@ -318,7 +318,7 @@ int
GrepForDefine (const char *file, const char *string)
{
FILE *f;
- char s1[250], s2[50], s3[50];
+ char s1[51], s2[51], s3[51];
int r = 0;
double d1;
@@ -328,10 +328,10 @@ GrepForDefine (const char *file, const char *string)
}
do {
- r = fscanf(f, "%s", s1);
+ r = fscanf(f, "%50s", s1);
if (r == 1 && !strcmp(s1, "#define")) {
/* get next two words */
- r = fscanf(f, "%s %s", s2, s3);
+ r = fscanf(f, "%50s %50s", s2, s3);
if (r != 2) continue;
/* is the first word what we're looking for? */
if (!strcmp(s2, string)) {