summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2001-05-31 13:38:48 +0000
committerespie <espie@openbsd.org>2001-05-31 13:38:48 +0000
commita3ad20646fa3e0b5dacf250edc0ebf1efd3da4dd (patch)
treec84a05e65f2505aaeb1db16a1c2fa08a7c9ba08c
parentCorrectly implement most linking for alpha. (diff)
downloadwireguard-openbsd-a3ad20646fa3e0b5dacf250edc0ebf1efd3da4dd.tar.xz
wireguard-openbsd-a3ad20646fa3e0b5dacf250edc0ebf1efd3da4dd.zip
Simple guard against overflow. Better code to appear.
-rw-r--r--usr.bin/make/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index e911e480920..26bc458cc98 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: main.c,v 1.50 2001/05/29 17:00:54 espie Exp $ */
+/* $OpenBSD: main.c,v 1.51 2001/05/31 13:38:48 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -811,7 +811,8 @@ ReadMakefile(p, q)
goto found;
/* if we've chdir'd, rebuild the path name */
if (curdir != objdir && *fname != '/') {
- (void)sprintf(path, "%s/%s", curdir, fname);
+ (void)snprintf(path, sizeof path, "%s/%s", curdir,
+ fname);
if ((stream = fopen(path, "r")) != NULL) {
fname = estrdup(path);
goto found;