err/err.c: fix "wraparound" bug in ERR_set_error_data.
authorAndy Polyakov <appro@openssl.org>
Wed, 16 Aug 2017 21:06:57 +0000 (23:06 +0200)
committerAndy Polyakov <appro@openssl.org>
Fri, 18 Aug 2017 07:27:06 +0000 (09:27 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit d3d880ce01cfaf0091f46a2f6b5bd146d47a93e7)

crypto/err/err.c

index 03d407cab8e1373f843ecc3c277988bd0cfde23d..cfe0e8083f39babe72ce7f5e4eff2385e9ba0142 100644 (file)
@@ -1075,8 +1075,6 @@ void ERR_set_error_data(char *data, int flags)
         return;
 
     i = es->top;
-    if (i == 0)
-        i = ERR_NUM_ERRORS - 1;
 
     err_clear_data(es, i);
     es->err_data[i] = data;