Skip to content

Limit the boundary of ocsp response string from memory size to actual payload size#39

Merged
markt-asf merged 1 commit intoapache:mainfrom
Chenjp:ocsp_payload_len
Feb 13, 2026
Merged

Limit the boundary of ocsp response string from memory size to actual payload size#39
markt-asf merged 1 commit intoapache:mainfrom
Chenjp:ocsp_payload_len

Conversation

@Chenjp
Copy link
Contributor

@Chenjp Chenjp commented Feb 13, 2026

Code review: Using actual ocsp response payload size.

int buflen = 2048;
int totalread = 1689; // Observed response size of openssl ocsp responder

Then buf[1689...2047] were filled with uninitialized memory data.

(Particular DER payload + uninitialized memory) could lead to potential DER decoder crash in #d2i_OCSP_RESPONSE_bio.

Code review: Using actual ocsp response payload size.
@markt-asf
Copy link
Contributor

That would require a corrupt payload. If the payload is corrupt, it can crash the decoder regardless of length.

That said, I don't see the harm in limiting the copy size as proposed.

@markt-asf markt-asf merged commit ca6206d into apache:main Feb 13, 2026
markt-asf pushed a commit that referenced this pull request Feb 13, 2026
Code review: Using actual ocsp response payload size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments