Skip to content

Commit 5a4c634

Browse files
committed
Address code review
1 parent 6bb122d commit 5a4c634

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

examples/ocsp_responder/ocsp_responder.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,8 @@ static int ParseHttpRequest(const byte* httpReq, int httpReqSz,
571571
return -1;
572572
}
573573

574-
/* Use Content-Length if available, otherwise use remaining data */
575574
if (*bodySz == 0) {
576-
*bodySz = httpReqSz - offset;
575+
return -1;
577576
}
578577

579578
/* Ensure that the claimed body length fits in the received data */
@@ -1082,6 +1081,9 @@ int main(int argc, char** argv)
10821081
func_args args;
10831082
int ret;
10841083

1084+
printf("The ocsp_responder.c example is only meant for testing. "
1085+
"Do not use this in a production environment.\n");
1086+
10851087
StartTCP();
10861088

10871089
#ifdef HAVE_WNR

wolfcrypt/src/asn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41673,7 +41673,7 @@ int DecodeOcspRequest(OcspRequest* req, const byte* input, word32 size)
4167341673
if (ret == 0) {
4167441674
GetASN_GetRef(&dataASN[OCSPREQUESTASN_IDX_TBS_REQ_SERIAL],
4167541675
&serial, &serialSz);
41676-
if (serialSz == 0 || serial == NULL)
41676+
if (serialSz == 0 || serial == NULL || serialSz > EXTERNAL_SERIAL_SIZE)
4167741677
ret = ASN_PARSE_E;
4167841678
}
4167941679
if (ret == 0) {

0 commit comments

Comments
 (0)