forked from wolfSSL/wolfssl
update comments and check error case
This commit is contained in:
18
src/ssl.c
18
src/ssl.c
@ -17076,10 +17076,22 @@ cleanup:
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int idx = wc_GetCurrentIdx();
|
int idx = wc_GetCurrentIdx();
|
||||||
if (idx > 0) {
|
if (idx < 0) {
|
||||||
idx = idx -1;
|
WOLFSSL_MSG("Error with getting current index!");
|
||||||
|
ret = BAD_STATE_E;
|
||||||
|
WOLFSSL_LEAVE("wolfSSL_ERR_get_error", ret);
|
||||||
|
|
||||||
|
/* panic and try to clear out nodes and reset queue state */
|
||||||
|
wc_ClearErrorNodes();
|
||||||
|
}
|
||||||
|
else if (idx > 0) {
|
||||||
|
idx -= 1;
|
||||||
|
wc_RemoveErrorNode(idx);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* if current idx is 0 then the queue only had one node */
|
||||||
|
wc_RemoveErrorNode(idx);
|
||||||
}
|
}
|
||||||
wc_RemoveErrorNode(idx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -812,8 +812,10 @@ int wc_AddErrorNode(int error, int line, char* buf, char* file)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the current index into the queue, can be greater than zero in cases
|
/* returns the current index into the queue, which is the node that
|
||||||
* where wc_PullErrorNode() has been callded. */
|
* wc_current_node is pointing to. It can be greater than zero in cases
|
||||||
|
* where wc_PullErrorNode() has been called without the node having been
|
||||||
|
* removed. */
|
||||||
int wc_GetCurrentIdx()
|
int wc_GetCurrentIdx()
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
Reference in New Issue
Block a user