miniupnpd: reject AddPinhole when InternalPort or RemortePort is empty
https://miniupnp.tuxfamily.org/forum/viewtopic.php?p=5839
This commit is contained in:
parent
5a003a4f56
commit
57ae40fe10
|
@ -1666,6 +1666,14 @@ AddPinhole(struct upnphttp * h, const char * action, const char * ns)
|
|||
protocol = GetValueFromNameValueList(&data, "Protocol");
|
||||
leaseTime = GetValueFromNameValueList(&data, "LeaseTime");
|
||||
|
||||
#ifdef UPNP_STRICT
|
||||
if (rem_port == NULL || rem_port[0] == '\0' || int_port == NULL || int_port[0] == '\0' )
|
||||
{
|
||||
ClearNameValueList(&data);
|
||||
SoapError(h, 402, "Invalid Args");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
rport = (unsigned short)(rem_port ? atoi(rem_port) : 0);
|
||||
iport = (unsigned short)(int_port ? atoi(int_port) : 0);
|
||||
ltime = leaseTime ? atoi(leaseTime) : -1;
|
||||
|
|
Loading…
Reference in New Issue