openssl_strerror_r: Fix handling of GNU strerror_r
authorVitezslav Cizek <vcizek@suse.com>
Thu, 28 Feb 2019 12:47:18 +0000 (13:47 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 4 Mar 2019 10:06:54 +0000 (10:06 +0000)
commite3b35d2b29e9446af83fcaa534e67e7b04a60d7a
tree1edd62224aebd8ad79680e94b968fef1904f74e8
parent68ad17e87467e93eab87fc2fce0da53d6a7653cc
openssl_strerror_r: Fix handling of GNU strerror_r

GNU strerror_r may return either a pointer to a string that the function
stores in buf, or a pointer to some (immutable) static string in which case
buf is unused.

In such a case we need to set buf manually.

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8371)
crypto/o_str.c