Skip to content

Commit 7aeb624

Browse files
committed
properly initialize data structure for SOAP parsing in ParseNameValue()
topelt field was not properly initialized. should fix #268
1 parent 7492fe4 commit 7aeb624

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Diff for: miniupnpc/upnpreplyparse.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* $Id: upnpreplyparse.c,v 1.19 2015/07/15 10:29:11 nanard Exp $ */
2-
/* MiniUPnP project
2+
/* vim: tabstop=4 shiftwidth=4 noexpandtab
3+
* MiniUPnP project
34
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4-
* (c) 2006-2015 Thomas Bernard
5+
* (c) 2006-2017 Thomas Bernard
56
* This software is subject to the conditions detailed
67
* in the LICENCE file provided within the distribution */
78

@@ -104,9 +105,7 @@ ParseNameValue(const char * buffer, int bufsize,
104105
struct NameValueParserData * data)
105106
{
106107
struct xmlparser parser;
107-
data->l_head = NULL;
108-
data->portListing = NULL;
109-
data->portListingLength = 0;
108+
memset(data, 0, sizeof(struct NameValueParserData));
110109
/* init xmlparser object */
111110
parser.xmlstart = buffer;
112111
parser.xmlsize = bufsize;

Diff for: miniupnpd/upnpreplyparse.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* $Id: upnpreplyparse.c,v 1.19 2015/07/15 10:29:11 nanard Exp $ */
2-
/* MiniUPnP project
2+
/* vim: tabstop=4 shiftwidth=4 noexpandtab
3+
* MiniUPnP project
34
* http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
4-
* (c) 2006-2015 Thomas Bernard
5+
* (c) 2006-2017 Thomas Bernard
56
* This software is subject to the conditions detailed
67
* in the LICENCE file provided within the distribution */
78

@@ -104,9 +105,7 @@ ParseNameValue(const char * buffer, int bufsize,
104105
struct NameValueParserData * data)
105106
{
106107
struct xmlparser parser;
107-
data->l_head = NULL;
108-
data->portListing = NULL;
109-
data->portListingLength = 0;
108+
memset(data, 0, sizeof(struct NameValueParserData));
110109
/* init xmlparser object */
111110
parser.xmlstart = buffer;
112111
parser.xmlsize = bufsize;

0 commit comments

Comments
 (0)