From 41647a814c72cc0834ee9165c6aa81667f14e3d1 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Mon, 6 Jan 2020 21:46:44 +0100 Subject: [PATCH] Handle improbable case were dev may be NULL, found by Coverity Signed-off-by: Joachim Nilsson --- src/tty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tty.c b/src/tty.c index 3f3f68f6..daf8512a 100644 --- a/src/tty.c +++ b/src/tty.c @@ -270,7 +270,8 @@ again: /* Replace @console with actual device */ if (arg && !strcmp(arg, "@console")) arg = dev; - entry->args[j++] = strdup(arg); + if (arg) + entry->args[j++] = strdup(arg); } entry->args[++j] = NULL; }