-
Notifications
You must be signed in to change notification settings - Fork 168
Use-after-free and heap-size-mismatch fix. #1136
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
Use-after-free and heap-size-mismatch fix. #1136
Conversation
|
Can one of the admins verify this patch? |
641d296 to
15e849d
Compare
src/vlogger/vlogger.cpp
Outdated
| uint8_t* g_p_vlogger_details = NULL; | ||
| uint32_t g_vlogger_usec_on_startup = 0; | ||
| bool g_vlogger_log_in_colors = MCE_DEFAULT_LOG_COLORS; | ||
| bool g_vlogger_log_in_colors = false; |
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.
What was wrong with existing assignment?
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.
Log in color has sense only when logging to tty (see here
libvma/src/vlogger/vlogger.cpp
Line 241 in 0dc96e0
| int file_fd = fileno(g_vlogger_file); |
g_vlogger_log_in_colors is not assigned. For file should be false. MCE_DEFAULT_LOG_COLORS properly processed here:libvma/src/vma/util/sys_vars.cpp
Line 492 in 0dc96e0
| log_colors = MCE_DEFAULT_LOG_COLORS; |
libvma/src/vma/util/sys_vars.cpp
Line 791 in 0dc96e0
| if ((env_ptr = getenv(SYS_VAR_LOG_COLORS)) != NULL) |
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.
accepted
src/vma/util/sys_vars.cpp
Outdated
| } | ||
|
|
||
| free(start); | ||
| free(start); |
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.
please consider fixing coding style issue.
1. Removed redundant header dependencies to allow building vlogger and state_machine independently from the rest of the code. 2. Fixed logic of set log color output parameter. 3. Rewrote the functions read_file_to_int (src/vma/util/utils.cpp) and env_to_cpuset (src/vma/util/sys_vars.cpp) to enable running the code with ASAN. 4. Fixed a new/delete size mismatch in src/vma/dev/rfs*. 5. Fixed a use-after-free issue in timer_handler.
15e849d to
d6ca475
Compare
|
Rebased to latest master and fixed formatting issues. |
|
Please split this PR to separate PRs. One for each mentioned item. |
Description
What
Use-after-free and heap-size-mismatch fix.
Change type
What kind of change does this PR introduce?
Check list