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

sprintf and strcpy are unsafe : buffer overflow is possible #338

Closed
aka-sps opened this issue Nov 30, 2018 · 2 comments
Closed

sprintf and strcpy are unsafe : buffer overflow is possible #338

aka-sps opened this issue Nov 30, 2018 · 2 comments

Comments

@aka-sps
Copy link
Contributor

aka-sps commented Nov 30, 2018

https://github.com/riscv/riscv-openocd/blob/42be17aed602405a8a36aa06671ea7566ec3f2e4/src/target/riscv/riscv-013.c#L350

Use snprintf (Note: on buffer overflow last symbol is not '\0', need force)

https://github.com/riscv/riscv-openocd/blob/42be17aed602405a8a36aa06671ea7566ec3f2e4/src/target/riscv/riscv-013.c#L352

Use strncpy (Note: on buffer overflow last symbol is not '\0', need force)

@en-sc
Copy link
Collaborator

en-sc commented Jan 22, 2024

@aka-sps, I would like to close this. It is not an issue anymore. The code in question was changed by #892 and currently it is guaranteed that the buffer is sufficient.

@en-sc
Copy link
Collaborator

en-sc commented Jan 26, 2024

@aka-sps, I'm closing this one. Feel free to reopen, if you have any concerns.

@en-sc en-sc closed this as completed Jan 26, 2024
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

No branches or pull requests

2 participants