summaryrefslogtreecommitdiffstats
path: root/freebsd/crypto/openssl/crypto/o_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/crypto/openssl/crypto/o_str.c')
-rw-r--r--freebsd/crypto/openssl/crypto/o_str.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/freebsd/crypto/openssl/crypto/o_str.c b/freebsd/crypto/openssl/crypto/o_str.c
index 79d72a2c..6de7e7f5 100644
--- a/freebsd/crypto/openssl/crypto/o_str.c
+++ b/freebsd/crypto/openssl/crypto/o_str.c
@@ -233,7 +233,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.