From 13585f15c7f7dc28bbbba1661efb280d530d114c Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 18 Dec 2018 22:54:51 +0100 Subject: [PATCH] GetOutboundPinholeTimeout: check args --- miniupnpd/upnpsoap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/miniupnpd/upnpsoap.c b/miniupnpd/upnpsoap.c index e7193c0..997b325 100644 --- a/miniupnpd/upnpsoap.c +++ b/miniupnpd/upnpsoap.c @@ -1850,6 +1850,13 @@ GetOutboundPinholeTimeout(struct upnphttp * h, const char * action, const char * rem_port = GetValueFromNameValueList(&data, "RemotePort"); protocol = GetValueFromNameValueList(&data, "Protocol"); + if (!int_port || !ext_port || !protocol) + { + ClearNameValueList(&data); + SoapError(h, 402, "Invalid Args"); + return; + } + rport = (unsigned short)atoi(rem_port); iport = (unsigned short)atoi(int_port); /*proto = atoi(protocol);*/