sanitize <RemoteHost> arg of AddPinhole

see #228
This commit is contained in:
Thomas Bernard 2017-03-13 11:30:44 +01:00
parent 93845c5abe
commit 07a3729b59
1 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <ctype.h>
#include "macros.h"
#include "config.h"
@ -1621,8 +1622,14 @@ AddPinhole(struct upnphttp * h, const char * action, const char * ns)
goto clear_and_exit;
}
/* I guess it is useless to convert int_ip to literal ipv6 address */
if(rem_host)
{
/* trim */
while(isspace(rem_host[0]))
rem_host++;
}
/* rem_host should be converted to literal ipv6 : */
if(rem_host && (rem_host[0] != '\0'))
if(rem_host && (rem_host[0] != '\0') && (rem_host[0] != '*'))
{
struct addrinfo *ai, *p;
struct addrinfo hints;