-
Notifications
You must be signed in to change notification settings - Fork 8
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
Non-null terminated C string in openosc_get_process_name #5
Comments
Thanks for reporting this issue. BTW, the cmdline file is special, because it contains multiple NULL-terminated strings. We just need the first NULL terminated string.
|
Yes, but if the file path is too large, then the string will not be NUL terminated. And you have a call to |
Yes, agree. I will fix the get_process_name function to always return NULL-terminated string. |
This issue has been fixed by commit #6 |
Yes, you are right. Thanks for pointing this out. :-) |
https://github.com/cisco/OpenOSC/blob/master/src/openosc_support.c#L58-L62
If the last character from
/proc/%d/cmdline
is not '\n', the string will not be NUL terminated.Found by @hallyn
The text was updated successfully, but these errors were encountered: