summaryrefslogtreecommitdiffstats
path: root/Source/CTest/Curl
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CTest/Curl')
-rw-r--r--Source/CTest/Curl/strerror.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Source/CTest/Curl/strerror.c b/Source/CTest/Curl/strerror.c
index 3179dd6..fafe9ec 100644
--- a/Source/CTest/Curl/strerror.c
+++ b/Source/CTest/Curl/strerror.c
@@ -539,11 +539,20 @@ const char *Curl_strerror(struct connectdata *conn, int err)
/* this version of strerror_r() only *might* use the buffer we pass to
the function, but it always returns the error message as a pointer,
so we must copy that string unconditionally */
+ if ( !msg )
+ {
+ msg = "Unknown System Error";
+ }
strncpy(buf, msg, max);
}
#endif /* end of HAVE_GLIBC_STRERROR_R */
#else /* HAVE_STRERROR_R */
- strncpy(buf, strerror(err), max);
+ char *msg = strerror(err);
+ if ( !msg )
+ {
+ msg = "Unknown System Error";
+ }
+ strncpy(buf, msg, max);
#endif /* end of HAVE_STRERROR_R */
#endif /* end of ! Windows */