Make sure build_SYS_str_reasons() preserves errno
authorMatt Caswell <matt@openssl.org>
Wed, 21 Nov 2018 11:44:42 +0000 (11:44 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 10 Dec 2018 10:22:05 +0000 (10:22 +0000)
commit99992ad22019e752c7b103a45f860a48b6bc0972
tree27aba4b601955a6516397cc41f033df1b8812677
parent4bd0db1feaaf97fbc2bd31f54f1fbdeab80b2b1a
Make sure build_SYS_str_reasons() preserves errno

This function can end up being called during ERR_get_error() if we are
initialising. ERR_get_error() must preserve errno since it gets called via
SSL_get_error(). If that function returns SSL_ERROR_SYSCALL then you are
supposed to inspect errno.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7680)

(cherry picked from commit 71b1ceffc4c795f5db21861dd1016fbe23a53a53)
crypto/err/err.c
e_os.h