Skip to content

Commit

Permalink
Check wBioDataLen negative as a long instead of uint
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankiesz authored Dec 6, 2023
1 parent e3cb6f9 commit be796ac
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/source/Crypto/Tls_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ STATUS tlsSessionPutApplicationData(PTlsSession pTlsSession, PBYTE pData, UINT32

SIZE_T wBioDataLen = 0;
PCHAR wBioBuffer = NULL;
LONG wBioGetMemDataRet = 0;

CHK(pTlsSession != NULL, STATUS_NULL_ARG);

Expand All @@ -212,8 +213,9 @@ STATUS tlsSessionPutApplicationData(PTlsSession pTlsSession, PBYTE pData, UINT32
}
}

wBioDataLen = (SIZE_T) BIO_get_mem_data(SSL_get_wbio(pTlsSession->pSsl), &wBioBuffer);
CHK_ERR(wBioDataLen >= 0, STATUS_SEND_DATA_FAILED, "BIO_get_mem_data failed");
wBioGetMemDataRet = BIO_get_mem_data(SSL_get_wbio(pTlsSession->pSsl), &wBioBuffer);
CHK_ERR(wBioGetMemDataRet >= 0, STATUS_SEND_DATA_FAILED, "BIO_get_mem_data failed");
wBioDataLen = (SIZE_T) wBioGetMemDataRet;

if (wBioDataLen > 0) {
retStatus =
Expand Down

0 comments on commit be796ac

Please sign in to comment.