mirror of
https://github.com/swaywm/sway.git
synced 2026-03-30 11:10:59 -04:00
Fix memory errors
- read_line: OOB write when a line in /proc/modules contains a terminating character at size position. - handle_view_created: Ensure that the list_t returned by criteria_for is free'd after use - ipc_event_binding_keyboard/ipc_event_binding: Properly handle json_object reference counting and ownership.
This commit is contained in:
parent
a571506d0e
commit
aa15629f17
3 changed files with 9 additions and 3 deletions
|
|
@ -36,7 +36,7 @@ char *read_line(FILE *file) {
|
|||
}
|
||||
string[length++] = c;
|
||||
}
|
||||
if (length + 1 == size) {
|
||||
if (length + 1 >= size) {
|
||||
char *new_string = realloc(string, length + 1);
|
||||
if (!new_string) {
|
||||
free(string);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue