summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/main.c
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2000-11-30 13:56:19 +0000
committerwill <will@FreeBSD.org>2000-11-30 13:56:19 +0000
commit4e7062f7a76f231ee5e81e160fac28829caa7f6a (patch)
treec3355f0f44b765a51b60d042f361f787b2298e1f /usr.bin/make/main.c
parent56b0ddae6c97b0d229fa62bc685d8379452c108b (diff)
downloadFreeBSD-src-4e7062f7a76f231ee5e81e160fac28829caa7f6a.zip
FreeBSD-src-4e7062f7a76f231ee5e81e160fac28829caa7f6a.tar.gz
Format string paranoia. This should avoid potential buffer overflows from
user input (in its ever-broadening definition). Obtained from: NetBSD
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r--usr.bin/make/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 33719e8..97f4a85 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -928,7 +928,7 @@ ReadMakefile(p, q)
} else {
/* if we've chdir'd, rebuild the path name */
if (curdir != objdir && *fname != '/') {
- (void)sprintf(path, "%s/%s", curdir, fname);
+ (void)snprintf(path, MAXPATHLEN, "%s/%s", curdir, fname);
if ((stream = fopen(path, "r")) != NULL) {
fname = path;
goto found;
OpenPOWER on IntegriCloud