From eb185bfa47bad124149d8f921825231141d10b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 14 Aug 2024 08:53:21 +0200 Subject: [PATCH] utils/xtgettcap: fix possible NULL deref, found by -fanalyzer --- utils/xtgettcap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/xtgettcap.c b/utils/xtgettcap.c index 069a9ecb..82ee0085 100644 --- a/utils/xtgettcap.c +++ b/utils/xtgettcap.c @@ -141,6 +141,9 @@ main(int argc, const char *const *argv) const char *key = strtok(key_value, "="); const char *value = strtok(NULL, "="); + if (key == NULL) + continue; + #if 0 assert((success && value != NULL) || (!success && value == NULL));