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:26:48 +0000 (09:26 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit d3d880ce01cfaf0091f46a2f6b5bd146d47a93e7)

crypto/err/err.c

index 57b9576ea6af6b83a0db3603d3591da110abce5e..84eabc17726e271b22f9387f2eda2b1d72a2073a 100644 (file)
@@ -702,8 +702,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;