From 259984f730c4d7b01b741e433676be45dfe05ecd Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 2 Oct 2019 07:07:32 -0700 Subject: [PATCH] lmkd: Avoid potential out of buffer write Our buffer needs enough space for the '\0' terminator character as well. Test: TreeHugger Change-Id: Ib85d08dacf87b93d5f8b35b033ca0ec478868e66 --- lmkd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lmkd.c b/lmkd.c index 449088a..28f7616 100644 --- a/lmkd.c +++ b/lmkd.c @@ -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;