Commit 665d9e30 authored by unknown's avatar unknown
Browse files

Bug#25344 Segmentation violation when try to run the perror utility

 - strerror might return NULL on some platforms


extra/perror.c:
  Backport fix from 5.0
parent b93d81a8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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