lmkd: Avoid potential out of buffer write

Our buffer needs enough space for the '\0' terminator character
as well.

Test: TreeHugger
Change-Id: Ib85d08dacf87b93d5f8b35b033ca0ec478868e66
This commit is contained in:
Greg Kaiser 2019-10-02 07:07:32 -07:00
parent 8b016be930
commit 259984f730
1 changed files with 1 additions and 1 deletions

2
lmkd.c
View File

@ -1394,7 +1394,7 @@ static int zoneinfo_parse(struct zoneinfo *zi) {
char *buf;
char *save_ptr;
char *line;
char zone_name[LINE_MAX];
char zone_name[LINE_MAX + 1];
struct zoneinfo_node *node = NULL;
int node_idx = 0;
int zone_idx = 0;