Skip to content
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

fixing a possible write beyond the array boundary. #1028

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

Conversation

ihsinme
Copy link
Contributor

@ihsinme ihsinme commented Mar 9, 2022

If you don't initialize array buf and use strlen to determine the zero length, there is a possibility that the value of function memset will go beyond array buf. This will happen if there are no zeros in the declared array.

If you don't initialize array `buf` and use `strlen` to determine the zero length, there is a possibility that the value of function `memset` will go beyond array `buf`. This will happen if there are no zeros in the declared array.
@ihsinme
Copy link
Contributor Author

ihsinme commented Apr 5, 2022

good afternoon.
any news on this PR?

@zopsicle
Copy link

On line 262 it also calls strcpy(buf,rep); with seemingly no bounds check? If rep is larger than 1024 then it’ll overflow the buffer. Not an immediate problem as strrep is currently only called with constants and localized messages, but if it ever ends up being called with user input this is catastrophic.

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