check invalid values for ExternalPort
This commit is contained in:
parent
a712218af8
commit
527dd946ef
|
@ -675,6 +675,12 @@ GetSpecificPortMappingEntry(struct upnphttp * h, const char * action, const char
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eport = (unsigned short)atoi(ext_port);
|
eport = (unsigned short)atoi(ext_port);
|
||||||
|
if(eport == 0)
|
||||||
|
{
|
||||||
|
ClearNameValueList(&data);
|
||||||
|
SoapError(h, 402, "Invalid Args");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO : add r_host as an input parameter ...
|
/* TODO : add r_host as an input parameter ...
|
||||||
* We prevent several Port Mapping with same external port
|
* We prevent several Port Mapping with same external port
|
||||||
|
@ -758,6 +764,12 @@ DeletePortMapping(struct upnphttp * h, const char * action, const char * ns)
|
||||||
#endif /* SUPPORT_REMOTEHOST */
|
#endif /* SUPPORT_REMOTEHOST */
|
||||||
|
|
||||||
eport = (unsigned short)atoi(ext_port);
|
eport = (unsigned short)atoi(ext_port);
|
||||||
|
if(eport == 0)
|
||||||
|
{
|
||||||
|
ClearNameValueList(&data);
|
||||||
|
SoapError(h, 402, "Invalid Args");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
syslog(LOG_INFO, "%s: external port: %hu, protocol: %s",
|
syslog(LOG_INFO, "%s: external port: %hu, protocol: %s",
|
||||||
action, eport, protocol);
|
action, eport, protocol);
|
||||||
|
|
Loading…
Reference in New Issue