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:11:05 +0000 (10:11 +0000)
commit99f0c7a8a6999e2f78fc065e4da78643ae14c14c
tree187a73ca64e784fd7f4ea46583115ecff8ef178c
parentc352bd07ed2ff872876534c950a6968d75ef121e
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)

(cherry picked from commit e3b35d2b29e9446af83fcaa534e67e7b04a60d7a)
crypto/o_str.c