summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-09-26 10:30:41 +0000
committerotto <otto@openbsd.org>2006-09-26 10:30:41 +0000
commitbfb4b52d42b92c9545476f0850d4c266897f5fd5 (patch)
tree9dc249dcb0608aa9d490c6e8ce0f01065ef41aa8
parentaccidental extra %s in ddb printf (diff)
downloadwireguard-openbsd-bfb4b52d42b92c9545476f0850d4c266897f5fd5.tar.xz
wireguard-openbsd-bfb4b52d42b92c9545476f0850d4c266897f5fd5.zip
authunix_create_default() might return NULL; spotted by tbert;
ok deraadt@
-rw-r--r--usr.bin/rusers/rusers.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c
index 234b4edd76b..bd83bef2bd2 100644
--- a/usr.bin/rusers/rusers.c
+++ b/usr.bin/rusers/rusers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rusers.c,v 1.26 2003/08/04 17:06:46 deraadt Exp $ */
+/* $OpenBSD: rusers.c,v 1.27 2006/09/26 10:30:41 otto Exp $ */
/*
* Copyright (c) 2001, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -47,7 +47,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: rusers.c,v 1.26 2003/08/04 17:06:46 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: rusers.c,v 1.27 2006/09/26 10:30:41 otto Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -489,7 +489,7 @@ allhosts(void)
{
enum clnt_stat stat;
struct itimerval timeout;
- AUTH *unix_auth = authunix_create_default();
+ AUTH *unix_auth;
size_t outlen[2];
int sock[2] = { -1, -1 };
int i, maxfd, rval;
@@ -505,6 +505,9 @@ allhosts(void)
utmp_array up3;
XDR xdr;
+ if ((unix_auth = authunix_create_default()) == NULL)
+ err(1, "can't create auth handle");
+
if (getifaddrs(&ifap) != 0)
err(1, "can't get list of interface addresses");