Skip to content

log: pass the correct length to vsnprintf#6168

Merged
keszybz merged 1 commit intosystemd:masterfrom
evverx:fix-crash-6147
Jun 22, 2017
Merged

log: pass the correct length to vsnprintf#6168
keszybz merged 1 commit intosystemd:masterfrom
evverx:fix-crash-6147

Conversation

@evverx
Copy link
Contributor

@evverx evverx commented Jun 21, 2017

This prevents log_object_internalv from corrupting the stack.
Closes #6147.

Many thanks to Walter Doekes for the code review.

This prevents log_object_internalv from corrupting the stack.
Closes systemd#6147.

Many thanks to Walter Doekes for the code review.
src/basic/log.c Outdated
PROTECT_ERRNO;
char *buffer, *b;
size_t l;
size_t l = LINE_MAX;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should probably get rid of l and always use LINE_MAX. I will fix that.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, looks good, once l is gone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am sorry for the delay. I have just updated the PR. Please take a look.

@evverx evverx added the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Jun 21, 2017
@evverx evverx removed the reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks label Jun 21, 2017
@keszybz keszybz merged commit 1741b25 into systemd:master Jun 22, 2017
@evverx evverx deleted the fix-crash-6147 branch June 22, 2017 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants