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

LogItem: Fix off-by-one error for buffer copy #609

Merged
merged 1 commit into from Feb 20, 2021

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Feb 20, 2021

Fix loop condition to not overwrite last null char for avoiding buffer overrun.

Fix loop condition to not overwrite last null char for avoiding
buffer overrun.
@ma8ma ma8ma added the bug バグの追跡 label Feb 20, 2021
@ma8ma ma8ma added this to In progress in State of JDim-v0.5.0+ via automation Feb 20, 2021
@ma8ma ma8ma merged commit 3534d09 into JDimproved:master Feb 20, 2021
State of JDim-v0.5.0+ automation moved this from In progress to Done Feb 20, 2021
@ma8ma ma8ma deleted the logitem-fix-off-by-one-error branch February 20, 2021 12:18
Comment on lines +63 to +64
for( size_t i = 0, i2 = 0; i < LOGITEM_SIZE_HEAD -1 && i2 < msg.length(); ++i2 ){
if( msg[ i2 ] != ' ' ) head[ i++ ] = msg[ i2 ];
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headをstd::stringに変えてみる予定

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug バグの追跡
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant