summaryrefslogtreecommitdiff
path: root/crypto/o_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/o_str.c')
-rw-r--r--crypto/o_str.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/o_str.c b/crypto/o_str.c
index 1dbd70d58c4dd..9ad7a89dcadfe 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -231,7 +231,7 @@ int openssl_strerror_r(int errnum, char *buf, size_t buflen)
* buf is left unused.
*/
err = strerror_r(errnum, buf, buflen);
- if (err == NULL)
+ if (err == NULL || buflen == 0)
return 0;
/*
* If err is statically allocated, err != buf and we need to copy the data.