pull some fixes from upstream to avoid crashes by null pointer dereference

ok bket@
This commit is contained in:
steven 2019-03-19 17:28:32 +00:00
parent 73eeecb194
commit a280ce5f31
2 changed files with 30 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.19 2019/03/11 20:05:23 bket Exp $
# $OpenBSD: Makefile,v 1.20 2019/03/19 17:28:32 steven Exp $
COMMENT= UPnP IGD daemon
DISTNAME= miniupnpd-2.1
REVISION= 0
REVISION= 1
WANTLIB += c crypto kvm ssl

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-upnpsoap_c,v 1.4 2019/03/19 17:28:32 steven Exp $
Index: upnpsoap.c
--- upnpsoap.c.orig
+++ upnpsoap.c
@@ -590,7 +590,7 @@ AddAnyPortMapping(struct upnphttp * h, const char * ac
if(leaseduration == 0)
leaseduration = 604800;
- if (!int_ip || !ext_port || !int_port)
+ if (!int_ip || !ext_port || !int_port || !protocol)
{
ClearNameValueList(&data);
SoapError(h, 402, "Invalid Args");
@@ -1841,6 +1841,13 @@ GetOutboundPinholeTimeout(struct upnphttp * h, const c
rem_host = GetValueFromNameValueList(&data, "RemoteHost");
rem_port = GetValueFromNameValueList(&data, "RemotePort");
protocol = GetValueFromNameValueList(&data, "Protocol");
+
+ if (!int_port || !rem_port || !protocol)
+ {
+ ClearNameValueList(&data);
+ SoapError(h, 402, "Invalid Args");
+ return;
+ }
rport = (unsigned short)atoi(rem_port);
iport = (unsigned short)atoi(int_port);