From fd6525652df23bb2b62a881f8a41218653bc9cb4 Mon Sep 17 00:00:00 2001 From: Petar Kapris Date: Fri, 18 Dec 2020 14:51:21 +0100 Subject: [PATCH] Fix length of dev global variable Since the ut_line field is not guarranteed to be null terminated, in order to get a proper null terminated string, dev is required to have an extra byte at the end. --- timeoutd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/timeoutd.c b/timeoutd.c index d5d9b17..1fd1a27 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -138,7 +138,7 @@ struct config_ent { struct config_ent *config[MAXLINES + 1]; char errmsg[256]; -char dev[sizeof(utmpp->ut_line)]; +char dev[sizeof(utmpp->ut_line) + 1]; unsigned char limit_type; int configline = 0; int pending_reread = 0;