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:24:44 +0000 (09:24 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/err/err.c

index 07911e2..8d0da79 100644 (file)
@@ -730,8 +730,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;