-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
id: Handle NULL pointer gracefully within cstr2cow
macro
#7810
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
id: Handle NULL pointer gracefully within cstr2cow
macro
#7810
Conversation
> getlogin() returns a pointer to a string containing the name of the user logged in on the controlling terminal of the process, or a NULL pointer if this information cannot be determined. Ref: https://linux.die.net/man/3/getlogin
GNU testsuite comparison:
|
i think you can probably add a test here |
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
Segfault fixed by 292fb92
I suggest trying to see if |
GNU testsuite comparison:
|
* id: Handle NULL pointer gracefully within `cstr2cow` macro > getlogin() returns a pointer to a string containing the name of the user logged in on the controlling terminal of the process, or a NULL pointer if this information cannot be determined. Ref: https://linux.die.net/man/3/getlogin * id: Remove redundant std::ffi:: prefix from CStr * id: Add comment for the null check Co-authored-by: Sylvestre Ledru <sylvestre@debian.org> * id: Remove skip for test that should not segfault anymore Segfault fixed by 292fb92 --------- Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
This PR fixes a segmentation fault with the
id -p
command when thegetlogin
function is unable to determine the logged-in user.Ref: https://linux.die.net/man/3/getlogin
fixes #7808