summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgsoares <gsoares@openbsd.org>2017-02-22 14:40:46 +0000
committergsoares <gsoares@openbsd.org>2017-02-22 14:40:46 +0000
commit735d6375394f49dc42b7040d37d55b8d287dbdc1 (patch)
tree9a603770696a3162eff211d60adfe9524d9304fe
parentldapd regress tests depends on openldap-client, check (diff)
downloadwireguard-openbsd-735d6375394f49dc42b7040d37d55b8d287dbdc1.tar.xz
wireguard-openbsd-735d6375394f49dc42b7040d37d55b8d287dbdc1.zip
print a formatted errx() string instead of segfault,
by checking argc correctly. ok guenther@
-rw-r--r--usr.sbin/ldapd/btest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/btest.c b/usr.sbin/ldapd/btest.c
index f0dfea93860..0eb6d72c40c 100644
--- a/usr.sbin/ldapd/btest.c
+++ b/usr.sbin/ldapd/btest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: btest.c,v 1.2 2015/12/24 17:47:57 mmcc Exp $ */
+/* $OpenBSD: btest.c,v 1.3 2017/02/22 14:40:46 gsoares Exp $ */
/* Simple test program for the btree database. */
/*
@@ -74,7 +74,7 @@ main(int argc, char **argv)
else
printf("FAIL\n");
} else if (strcmp(argv[0], "del") == 0) {
- if (argc < 1)
+ if (argc < 2)
errx(1, "missing argument");
key.data = argv[1];
key.size = strlen(key.data);