]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
ulogd: fix parse-error check
authorJeremy Sowden <jeremy@azazel.net>
Sat, 3 Dec 2022 19:02:09 +0000 (19:02 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 8 Dec 2022 20:48:51 +0000 (21:48 +0100)
If `config_parse_file` returns `-ERRTOOLONG`, `config_errce` may be
`NULL`.  However, the calling function checks whether
`config_errce->key` is `NULL` instead.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/ulogd.c

index b02f2602a895d8e7d0e21ef6ef6665e8689f8dac..8ea9793ec0fb608a9d9d8511e8a25cecc967b7b0 100644 (file)
@@ -1134,7 +1134,7 @@ static int parse_conffile(const char *section, struct config_keyset *ce)
                                "section \"%s\" not found\n", section);
                        break;
                case -ERRTOOLONG:
-                       if (config_errce->key)
+                       if (config_errce)
                                ulogd_log(ULOGD_ERROR,
                                          "string value too long for key \"%s\"\n",
                                          config_errce->key);