added sanity check on return from recv callback
This commit is contained in:
parent
6616975f81
commit
b17b81ef43
@ -108,6 +108,7 @@ enum CyaSSL_ErrorCodes {
|
||||
OUT_OF_ORDER_E = -273, /* out of order message */
|
||||
BAD_KEA_TYPE_E = -274, /* bad KEA type found */
|
||||
SANITY_CIPHER_E = -275, /* sanity check on cipher error */
|
||||
RECV_OVERFLOW_E = -276, /* RXCB returned more than rqed */
|
||||
/* add strings to SetErrorString !!!!! */
|
||||
|
||||
/* begin negotiation parameter errors */
|
||||
|
@ -3856,6 +3856,9 @@ static int GetInputData(CYASSL *ssl, word32 size)
|
||||
|
||||
if (in == WANT_READ)
|
||||
return WANT_READ;
|
||||
|
||||
if (in > inSz)
|
||||
return RECV_OVERFLOW_E;
|
||||
|
||||
ssl->buffers.inputBuffer.length += in;
|
||||
inSz -= in;
|
||||
@ -5177,6 +5180,10 @@ void SetErrorString(int error, char* str)
|
||||
XSTRNCPY(str, "Sanity check on ciphertext failed", max);
|
||||
break;
|
||||
|
||||
case RECV_OVERFLOW_E:
|
||||
XSTRNCPY(str, "Receive callback returned more than requested", max);
|
||||
break;
|
||||
|
||||
default :
|
||||
XSTRNCPY(str, "unknown error number", max);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user