-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Miscellaneous fixes #1914
Miscellaneous fixes #1914
Conversation
Fixes a buffer overflow in get_pid_exe(), a use-after-free error in bcc_usdt_get_probe_argctype() and a possible NULL pointer dereference in find_debug_via_debuglink().
Leaked file descriptors in bpf_attach_uprobe() and verify_checksum(). Memory leaks in Parser::func_add() and bcc_procutils_language().
src/cc/bcc_proc.c
Outdated
@@ -446,8 +446,10 @@ const char *bcc_procutils_language(int pid) { | |||
while (isspace(mapname[0])) mapname++; | |||
for (i = 0; i < nb_languages; i++) { | |||
snprintf(pathname, sizeof(pathname), "/lib%s", languages[i]); | |||
if (strstr(mapname, pathname)) | |||
if (strstr(mapname, pathname)) { | |||
fclose(procfile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you correct the indentation for the above fclose(procfile)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for all these fixes! Only a minor format change is needed.
[buildbot, ok to test] |
1 similar comment
[buildbot, ok to test] |
[buildbot, ok to test] |
1 similar comment
[buildbot, ok to test] |
* Fix multiple memory access errors Fixes a buffer overflow in get_pid_exe(), a use-after-free error in bcc_usdt_get_probe_argctype() and a possible NULL pointer dereference in find_debug_via_debuglink(). * Fix multiple ressource leaks Leaked file descriptors in bpf_attach_uprobe() and verify_checksum(). Memory leaks in Parser::func_add() and bcc_procutils_language(). * fixup! Fix multiple ressource leaks
This fixes a few bug uncovered by a Coverity scan: some leaks and more importantly some memory access errors.