Skip to content

Fix an off-by-one buffer error in asn.c. #8724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seego5555
Copy link

Need to ensure "finish-start" is less than the size before using it as an index a few lines down.

Description

On line 26156 of asn.c, a check is made that "finish-start" is greater than the size of the buffer and if so, it returns an error. A few lines down the buffer is accessed at index "finish-start", which will write off the end of the buffer if "finish-start" equals the size of the buffer. The fix is to ensure that "finish-start" is less than the buffer size by changing "<" to "<=" on the comparison.

Need to ensure "finsh-start" is less than the size before using it as an
index a few lines down.
@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@dgarske
Copy link
Contributor

dgarske commented May 2, 2025

Hi @seego5555 ,

Thank for your this PR. I do not see you setup as a contributor. Typically for a small PR like this we will treat as bug report and then reproduce fix ourselves. Can you tell us more about your project, where you are located and how you discovered this issue? If you would like to keep details private please email support at wolfssl dot com and reference this PR.

Thanks,
David Garske, wolfSSL

@dgarske dgarske self-assigned this May 2, 2025
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.

3 participants