summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2009-06-01 23:18:29 +0000
committerschwarze <schwarze@openbsd.org>2009-06-01 23:18:29 +0000
commitefc9a8a55b47b83c9b764599f1796172fc930b8b (patch)
treed5eb241e1488f50b238d16243d04545185bf24c5
parentUse the md atomic code on mips64 instead of the horrid slow code. Should have (diff)
downloadwireguard-openbsd-efc9a8a55b47b83c9b764599f1796172fc930b8b.tar.xz
wireguard-openbsd-efc9a8a55b47b83c9b764599f1796172fc930b8b.zip
When an RPC client program encounters ENOMEM while trying to print
an error message, rather skip the error message than dereferencing a NULL pointer. debugging help and ok kjell@
-rw-r--r--lib/libc/rpc/clnt_perror.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/rpc/clnt_perror.c b/lib/libc/rpc/clnt_perror.c
index 33ca619522a..4b250991e8e 100644
--- a/lib/libc/rpc/clnt_perror.c
+++ b/lib/libc/rpc/clnt_perror.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clnt_perror.c,v 1.20 2007/09/12 08:16:02 moritz Exp $ */
+/* $OpenBSD: clnt_perror.c,v 1.21 2009/06/01 23:18:29 schwarze Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -239,7 +239,9 @@ clnt_spcreateerror(char *s)
void
clnt_pcreateerror(char *s)
{
- (void) fprintf(stderr, "%s", clnt_spcreateerror(s));
+ char *msg = clnt_spcreateerror(s);
+ if (msg)
+ (void) fprintf(stderr, "%s", msg);
}
static const char *const auth_errlist[] = {