summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-09-26 10:30:42 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-09-26 10:30:42 +0000
commita6f6c06a2302b50c895b27259aa85a3c801758ef (patch)
tree9def72aac7ff10283d9bfd24dfc05c5f0e2f5c32
parentbf5e5bd0d0daa6b866e3ba31eb79dca917b38277 (diff)
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");