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

[Process] fix cmdline cuteset #39

Merged
merged 1 commit into from
Mar 8, 2022
Merged

[Process] fix cmdline cuteset #39

merged 1 commit into from
Mar 8, 2022

Conversation

Gui774ume
Copy link

What does this PR do ?

This PR fixes a parsing bug in the fillSliceFromCmdline() function.

In some edge cases, /proc/[pid]/cmdline returns a buffer with more than one trailing \x00 (this is the case for the subprocesses of a postgres database). The current function trims the ending \x00 only, thus introducing empty strings in the returned list of arguments. This PR proposes to remove all trailing \x00 so that fillSliceFromCmdline() returns the exact number of arguments.

@Gui774ume Gui774ume added the bug label Mar 8, 2022
@Gui774ume Gui774ume merged commit d086941 into dd Mar 8, 2022
@brycekahle brycekahle added the upstreamed change has been merged upstream label Jan 18, 2024
@brycekahle brycekahle deleted the will/fix-cmdline-cutset branch January 18, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug upstreamed change has been merged upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants