miniupnpd/netfilter_nft: more logs in set_rdr_name()

see #481
This commit is contained in:
Thomas Bernard 2020-09-26 17:42:26 +02:00
parent 426f9a1835
commit c9f6ddd102
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
1 changed files with 4 additions and 3 deletions

View File

@ -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;