From 52a5997b4a71e0539649546daf581200efcd8932 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 1 Jun 2009 23:18:30 +0000 Subject: 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@ --- lib/libc/rpc/clnt_perror.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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[] = { -- cgit v1.2.3