From 2fb664cb38b6b0d3bb04c3483f244e1cfd46a2ae Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Tue, 6 Feb 2007 23:00:18 +0100 Subject: [PATCH] Bug#25344 Segmentation violation when try to run the perror utility - strerror might return NULL on some platforms --- extra/perror.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extra/perror.c b/extra/perror.c index 69cd6f87aab..764f54eafe3 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -217,8 +217,11 @@ int main(int argc,char *argv[]) On some system, like NETWARE, strerror(unknown_error) returns a string 'Unknown Error'. To avoid printing it we try to find the error string by asking for an impossible big error message. + + On Solaris 2.8 it might return NULL */ - msg= strerror(10000); + if ((msg= strerror(10000)) == NULL) + msg= "Unknown Error"; /* Allocate a buffer for unknown_error since strerror always returns