diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-06-14 14:48:37 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-06-18 13:56:27 +0200 |
commit | e7a4682d0b347f0dfba629f4601a28801e54ad67 (patch) | |
tree | f8ca9437dda2f6c760fafb2192fb72ecc34c7ff8 /crypto/o_str.c | |
parent | e24bdcde5a80a7edeb1e0dbbcf45c3353a974974 (diff) |
Fix error handling at openssl_strerror_r
When bufsize == 0, openssl_strerror_r should return 0 (if _GNU_SOURCE is defined),
to be consistent with non-_GNU_SOURCE variants, which exhibit the same behavior.
Fix a few cases, where the return value of openssl_strerror_r was ignored.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9163)
Diffstat (limited to 'crypto/o_str.c')
-rw-r--r-- | crypto/o_str.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/o_str.c b/crypto/o_str.c index 3b271e745b..0403982004 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. |