diff options
author | 2018-02-11 03:55:45 +0000 | |
---|---|---|
committer | 2018-02-11 04:57:54 +0000 | |
commit | aa15629f17d65d45c02c30b6392e74d752b520b3 (patch) | |
tree | 3ae8f4c736c978ec5b9e29cfbcab0de8db058198 /common/readline.c | |
parent | Merge pull request #1584 from 4e554c4c/no_more_hups (diff) | |
download | sway-aa15629f17d65d45c02c30b6392e74d752b520b3.tar.gz sway-aa15629f17d65d45c02c30b6392e74d752b520b3.tar.zst sway-aa15629f17d65d45c02c30b6392e74d752b520b3.zip |
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.
Diffstat (limited to 'common/readline.c')
-rw-r--r-- | common/readline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/readline.c b/common/readline.c index cc40a2cc..d35ba73e 100644 --- a/common/readline.c +++ b/common/readline.c | |||
@@ -36,7 +36,7 @@ char *read_line(FILE *file) { | |||
36 | } | 36 | } |
37 | string[length++] = c; | 37 | string[length++] = c; |
38 | } | 38 | } |
39 | if (length + 1 == size) { | 39 | if (length + 1 >= size) { |
40 | char *new_string = realloc(string, length + 1); | 40 | char *new_string = realloc(string, length + 1); |
41 | if (!new_string) { | 41 | if (!new_string) { |
42 | free(string); | 42 | free(string); |