diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-06-01 23:18:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2009-06-01 23:18:30 +0000 |
commit | 52a5997b4a71e0539649546daf581200efcd8932 (patch) | |
tree | 492caf393643c3daafa79780a09e7bd103eba00a /lib/libc | |
parent | ebbcd751596f9757ece7b39f9ec509b94ee9842f (diff) |
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@
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/clnt_perror.c | 6 |
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[] = { |