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:
Dan Robertson 2018-02-11 03:55:45 +00:00 committed by Dan Robertson
parent a571506d0e
commit aa15629f17
No known key found for this signature in database
GPG key ID: 45C4A652C47E42A5
3 changed files with 9 additions and 3 deletions

View file

@ -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);