summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2001-11-27 01:02:48 +0000
committermillert <millert@openbsd.org>2001-11-27 01:02:48 +0000
commitc6fb88547b97ffaebeecc40c3947c1d11d208998 (patch)
tree78f970fdbabd818b0dfca7c607c23a2866d79856
parentcache the last deallocated voice and reuse on the next open. (diff)
downloadwireguard-openbsd-c6fb88547b97ffaebeecc40c3947c1d11d208998.tar.xz
wireguard-openbsd-c6fb88547b97ffaebeecc40c3947c1d11d208998.zip
Use strlcat() when adding to 'make_arg' via the -m flag to avoid
overflowing. Closes PR 2201.
-rw-r--r--libexec/rpc.yppasswdd/rpc.yppasswdd.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libexec/rpc.yppasswdd/rpc.yppasswdd.c b/libexec/rpc.yppasswdd/rpc.yppasswdd.c
index dc3bde7ee58..4434b5e8271 100644
--- a/libexec/rpc.yppasswdd/rpc.yppasswdd.c
+++ b/libexec/rpc.yppasswdd/rpc.yppasswdd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc.yppasswdd.c,v 1.9 1997/08/19 07:00:51 niklas Exp $ */
+/* $OpenBSD: rpc.yppasswdd.c,v 1.10 2001/11/27 01:02:48 millert Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: rpc.yppasswdd.c,v 1.9 1997/08/19 07:00:51 niklas Exp $";
+static char rcsid[] = "$OpenBSD: rpc.yppasswdd.c,v 1.10 2001/11/27 01:02:48 millert Exp $";
#endif
#include <sys/types.h>
@@ -90,8 +90,16 @@ main(argc, argv)
} else if (strcmp("-m", argv[i]) == 0) {
domake = 1;
while (i < argc) {
- strcat(make_arg, " ");
- strcat(make_arg, argv[i]);
+ if (strlcat(make_arg, " ",
+ sizeof(make_arg)) >=
+ sizeof(make_arg) ||
+ strlcat(make_arg, argv[i],
+ sizeof(make_arg)) >=
+ sizeof(make_arg)) {
+ (void) fprintf(stderr,
+ "-m argument too long.\n");
+ exit(1);
+ }
i++;
}
} else if (strcmp("-d", argv[i]) == 0