aboutsummaryrefslogtreecommitdiff
path: root/common/readline.c
diff options
context:
space:
mode:
authorDan Robertson <danlrobertson89@gmail.com>2018-02-11 03:55:45 +0000
committerDan Robertson <dan.robertson@anidata.org>2018-02-11 04:57:54 +0000
commitaa15629f17d65d45c02c30b6392e74d752b520b3 (patch)
tree3ae8f4c736c978ec5b9e29cfbcab0de8db058198 /common/readline.c
parenta571506d0e3abae0a8fe05a186cb5a33623bdf94 (diff)
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) {
}
string[length++] = c;
}
- if (length + 1 == size) {
+ if (length + 1 >= size) {
char *new_string = realloc(string, length + 1);
if (!new_string) {
free(string);