提交 563c05e2 编写于 作者: B Bodo Möller

fix out-of-bounds check in lock_dbg_cb (was too lose to detect all

invalid cases)

PR: 674
上级 643ecd2e
...@@ -163,7 +163,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line) ...@@ -163,7 +163,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
goto err; goto err;
} }
if (type < 0 || type > CRYPTO_NUM_LOCKS) if (type < 0 || type >= CRYPTO_NUM_LOCKS)
{ {
errstr = "type out of bounds"; errstr = "type out of bounds";
goto err; goto err;
......
...@@ -303,7 +303,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line) ...@@ -303,7 +303,7 @@ static void lock_dbg_cb(int mode, int type, const char *file, int line)
goto err; goto err;
} }
if (type < 0 || type > CRYPTO_NUM_LOCKS) if (type < 0 || type >= CRYPTO_NUM_LOCKS)
{ {
errstr = "type out of bounds"; errstr = "type out of bounds";
goto err; goto err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册