Open
Conversation
Consider the possibility of zero length.
Contributor
|
What problem does this solve? |
Member
|
EXAMPLES |
Contributor
|
The len < 0 case is already covered so again, what problem does this solve? |
Contributor
Author
|
The possibility should not happen because the i2d after d2i must be OK.
Regards,
Chenjp
…________________________________
From: Mark Thomas ***@***.***>
Sent: Monday, March 23, 2026 5:36:58 PM
To: apache/tomcat ***@***.***>
Cc: Chenjp ***@***.***>; Author ***@***.***>
Subject: Re: [apache/tomcat] Unexpected i2d_X509 length (PR #953)
[https://avatars.githubusercontent.com/u/4690029?s=20&v=4]markt-asf left a comment (apache/tomcat#953)<#953 (comment)>
The len < 0 case is already covered so again, what problem does this solve?
—
Reply to this email directly, view it on GitHub<#953?email_source=notifications&email_token=AAZXBLHRID2WFI5KGHKY22L4SEATVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJQHEZDGMZQGQZKM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4109233042>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZXBLDZZR2B7HHIPPRHGWT4SEATVAVCNFSM6AAAAACWAGOBX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMBZGIZTGMBUGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Contributor
Author
|
Impl source code:
```c
static int asn1_item_flags_i2d(const ASN1_VALUE *val, unsigned char **out,
const ASN1_ITEM *it, int flags)
{
if (out != NULL && *out == NULL) {
unsigned char *p, *buf;
int len;
len = ASN1_item_ex_i2d(&val, NULL, it, -1, flags);
if (len <= 0)
return len;
if ((buf = OPENSSL_malloc(len)) == NULL)
return -1;
p = buf;
ASN1_item_ex_i2d(&val, &p, it, -1, flags);
*out = buf;
return len;
}
return ASN1_item_ex_i2d(&val, out, it, -1, flags);
}
```
Regards,
Chenjp
…________________________________
From: Justin Chen ***@***.***>
Sent: Monday, March 23, 2026 11:10:44 PM
To: apache/tomcat ***@***.***>; apache/tomcat ***@***.***>
Cc: Author ***@***.***>
Subject: Re: [apache/tomcat] Unexpected i2d_X509 length (PR #953)
The possibility should not happen because the i2d after d2i must be OK.
Regards,
Chenjp
________________________________
From: Mark Thomas ***@***.***>
Sent: Monday, March 23, 2026 5:36:58 PM
To: apache/tomcat ***@***.***>
Cc: Chenjp ***@***.***>; Author ***@***.***>
Subject: Re: [apache/tomcat] Unexpected i2d_X509 length (PR #953)
[https://avatars.githubusercontent.com/u/4690029?s=20&v=4]markt-asf left a comment (apache/tomcat#953)<#953 (comment)>
The len < 0 case is already covered so again, what problem does this solve?
—
Reply to this email directly, view it on GitHub<#953?email_source=notifications&email_token=AAZXBLHRID2WFI5KGHKY22L4SEATVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJQHEZDGMZQGQZKM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4109233042>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZXBLDZZR2B7HHIPPRHGWT4SEATVAVCNFSM6AAAAACWAGOBX6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMBZGIZTGMBUGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Edge case: consider the possibility of zero length.