diff options
author | davygrvy <davygrvy@pobox.com> | 2003-12-23 03:58:58 (GMT) |
---|---|---|
committer | davygrvy <davygrvy@pobox.com> | 2003-12-23 03:58:58 (GMT) |
commit | bdb55bff6176c625c664d4ea5a4ec5187839d7a8 (patch) | |
tree | d4477aa339a8cbd1ecf9587f8896cb138b095540 | |
parent | f5fd054b74b84ee5113a32cf2fd325f81cee2216 (diff) | |
download | tcl-bdb55bff6176c625c664d4ea5a4ec5187839d7a8.zip tcl-bdb55bff6176c625c664d4ea5a4ec5187839d7a8.tar.gz tcl-bdb55bff6176c625c664d4ea5a4ec5187839d7a8.tar.bz2 |
prevent static buffer overflow (Doh!)
-rw-r--r-- | win/nmakehlp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 8d3175b..c6b5a5a 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:48:01 davygrvy Exp $ + * RCS: @(#) $Id: nmakehlp.c,v 1.4 2003/12/23 03:58:58 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)) { |