Skip to content

Commit bbad2a4

Browse files
Enforce max size of responses array in SendCertificateStatus.
Thanks to Zou Dikai for the report.
1 parent 7a4fa81 commit bbad2a4

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/internal.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25922,6 +25922,10 @@ int SendCertificateStatus(WOLFSSL* ssl)
2592225922

2592325923
if (idx > chain->length)
2592425924
break;
25925+
if ((i + 1) >= MAX_CERT_EXTENSIONS) {
25926+
ret = MAX_CERT_EXTENSIONS_ERR;
25927+
break;
25928+
}
2592525929
ret = CreateOcspRequest(ssl, request, cert, der.buffer,
2592625930
der.length, &ctxOwnsRequest);
2592725931
if (ret == 0) {
@@ -25950,6 +25954,11 @@ int SendCertificateStatus(WOLFSSL* ssl)
2595025954
else {
2595125955
while (ret == 0 &&
2595225956
NULL != (request = ssl->ctx->chainOcspRequest[i])) {
25957+
if ((i + 1) >= MAX_CERT_EXTENSIONS) {
25958+
ret = MAX_CERT_EXTENSIONS_ERR;
25959+
break;
25960+
}
25961+
2595325962
request->ssl = ssl;
2595425963
ret = CheckOcspRequest(SSL_CM(ssl)->ocsp_stapling,
2595525964
request, &responses[++i], ssl->heap);

0 commit comments

Comments
 (0)