[openssl-commits] [openssl] master update
Andy Polyakov
appro at openssl.org
Fri Aug 18 07:25:25 UTC 2017
The branch master has been updated
via 8909c2ceeee2c1683f783d905f975bca8626ad33 (commit)
via d3d880ce01cfaf0091f46a2f6b5bd146d47a93e7 (commit)
from 9ef73a6fd9a43a79783d2c68339c96532c3209f9 (commit)
- Log -----------------------------------------------------------------
commit 8909c2ceeee2c1683f783d905f975bca8626ad33
Author: Andy Polyakov <appro at openssl.org>
Date: Wed Aug 16 23:08:03 2017 +0200
err/err.c: improve readability.
Reviewed-by: Rich Salz <rsalz at openssl.org>
commit d3d880ce01cfaf0091f46a2f6b5bd146d47a93e7
Author: Andy Polyakov <appro at openssl.org>
Date: Wed Aug 16 23:06:57 2017 +0200
err/err.c: fix "wraparound" bug in ERR_set_error_data.
Reviewed-by: Rich Salz <rsalz at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/err/err.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 07911e2..eec0712 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -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;
@@ -802,9 +800,7 @@ int ERR_pop_to_mark(void)
while (es->bottom != es->top
&& (es->err_flags[es->top] & ERR_FLAG_MARK) == 0) {
err_clear(es, es->top);
- es->top -= 1;
- if (es->top == -1)
- es->top = ERR_NUM_ERRORS - 1;
+ es->top = es->top > 0 ? es->top - 1 : ERR_NUM_ERRORS - 1;
}
if (es->bottom == es->top)
@@ -825,9 +821,7 @@ int ERR_clear_last_mark(void)
top = es->top;
while (es->bottom != top
&& (es->err_flags[top] & ERR_FLAG_MARK) == 0) {
- top -= 1;
- if (top == -1)
- top = ERR_NUM_ERRORS - 1;
+ top = top > 0 ? top - 1 : ERR_NUM_ERRORS - 1;
}
if (es->bottom == top)
More information about the openssl-commits
mailing list