Skip to content

Commit 9254bf7

Browse files
Enforce max size of responses array in SendCertificateStatus.
Thanks to Zou Dikai for the report.
1 parent e815571 commit 9254bf7

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
@@ -25909,6 +25909,10 @@ int SendCertificateStatus(WOLFSSL* ssl)
2590925909

2591025910
if (idx > chain->length)
2591125911
break;
25912+
if ((i + 1) >= MAX_CERT_EXTENSIONS) {
25913+
ret = MAX_CERT_EXTENSIONS_ERR;
25914+
break;
25915+
}
2591225916
ret = CreateOcspRequest(ssl, request, cert, der.buffer,
2591325917
der.length, &ctxOwnsRequest);
2591425918
if (ret == 0) {
@@ -25937,6 +25941,11 @@ int SendCertificateStatus(WOLFSSL* ssl)
2593725941
else {
2593825942
while (ret == 0 &&
2593925943
NULL != (request = ssl->ctx->chainOcspRequest[i])) {
25944+
if ((i + 1) >= MAX_CERT_EXTENSIONS) {
25945+
ret = MAX_CERT_EXTENSIONS_ERR;
25946+
break;
25947+
}
25948+
2594025949
request->ssl = ssl;
2594125950
ret = CheckOcspRequest(SSL_CM(ssl)->ocsp_stapling,
2594225951
request, &responses[++i], ssl->heap);

0 commit comments

Comments
 (0)