miniupnpd: backport portrange-fix
[feed/routing.git] / miniupnpd / patches / 001-fix-get_portmappings_in_range-in-non-expand-case.patch
1 From 3b472b59e00b2be96cc1ef56fe30b64e7404d9ec Mon Sep 17 00:00:00 2001
2 From: Tomofumi Hayashi <s1061123@gmail.com>
3 Date: Mon, 9 Mar 2015 17:33:10 +0900
4 Subject: [PATCH] Fix get_portmappings_in_range() in non-expand case.
5
6 In get_portmappings_in_range(), array[] is not updated when
7 realloc() is not called, hence get_portmappings_in_range() is
8 always null. This fix changes to fill array[].
9 ---
10 miniupnpd/netfilter/iptcrdr.c | 4 ++--
11 1 file changed, 2 insertions(+), 2 deletions(-)
12
13 diff --git a/miniupnpd/netfilter/iptcrdr.c b/miniupnpd/netfilter/iptcrdr.c
14 index 99678e7..c7b8b7b 100644
15 --- a/miniupnpd/netfilter/iptcrdr.c
16 +++ b/miniupnpd/netfilter/iptcrdr.c
17 @@ -1434,9 +1434,9 @@ get_portmappings_in_range(unsigned short startport, unsigned short endport,
18 break;
19 }
20 array = tmp;
21 - array[*number] = eport;
22 - (*number)++;
23 }
24 + array[*number] = eport;
25 + (*number)++;
26 }
27 }
28 }
29 --
30 2.1.4
31