summaryrefslogtreecommitdiffstats
path: root/common/readline.c
diff options
context:
space:
mode:
authorLibravatar Dan Robertson <danlrobertson89@gmail.com>2018-02-11 03:55:45 +0000
committerLibravatar Dan Robertson <dan.robertson@anidata.org>2018-02-11 04:57:54 +0000
commitaa15629f17d65d45c02c30b6392e74d752b520b3 (patch)
tree3ae8f4c736c978ec5b9e29cfbcab0de8db058198 /common/readline.c
parentMerge pull request #1584 from 4e554c4c/no_more_hups (diff)
downloadsway-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.c2
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);