From c9f6ddd1028cae7cb2f0b9a5d355ce9f9fb07b2f Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 26 Sep 2020 17:42:26 +0200 Subject: [PATCH] miniupnpd/netfilter_nft: more logs in set_rdr_name() see #481 --- miniupnpd/netfilter_nft/nftnlrdr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/miniupnpd/netfilter_nft/nftnlrdr.c b/miniupnpd/netfilter_nft/nftnlrdr.c index 640ba7c..a6e9430 100644 --- a/miniupnpd/netfilter_nft/nftnlrdr.c +++ b/miniupnpd/netfilter_nft/nftnlrdr.c @@ -1,4 +1,4 @@ -/* +/* $Id: $ * vim: tabstop=4 shiftwidth=4 noexpandtab * MiniUPnP project * http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ @@ -161,7 +161,8 @@ shutdown_redirect(void) int set_rdr_name(rdr_name_type param, const char *string) { - if (string == NULL || strlen(string) > 30) { + if (string == NULL || strlen(string) > 30 || string[0] == '\0') { + syslog(LOG_ERR, "%s(): invalid string argument '%s'", "set_rdr_name", string) return -1; } switch (param) { @@ -178,7 +179,7 @@ set_rdr_name(rdr_name_type param, const char *string) nft_forward_chain = string; break; default: - syslog(LOG_ERR, "tried to set invalid string parameter: %d", param); + syslog(LOG_ERR, "%s(): tried to set invalid string parameter: %d", "set_rdr_name", param); return -2; } return 0;