Commit Graph

49 Commits

Author SHA1 Message Date
Fabrice Fontaine
a35724f7f8 SF Bug Tracker id 3498436 - Memory leak in Parser_processAttributeName
Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-07 02:30:57 PST

attr is not freed if ixmlNode_setNodeProperties or
ixmlNode_setAttributeNode return an error in
Parser_processAttributeName.
(cherry picked from commit 268abf72fb)
2012-03-07 16:03:13 -03:00
Fabrice Fontaine
908391ddf0 SF Bug Tracker id 3497159 - Bug fix in Parser_readFileOrBuffer
Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-05 14:20:58 PST

fileSize = ftell( xmlFilePtr ); can return a negative value, in this
case the function should exit (at the moment, the function exits only
if ftell returns 0).
(cherry picked from commit a8bcbe9491)
2012-03-06 20:06:37 -03:00
Yoichi NAKAYAMA
2c7658f98a SF Bug Tracker id 3325246 - Memory Leak in XML Parser
Submitted: Terry Farnham ( tfarnham ) - 2011-06-23 09:45:54 PDT

Details: The following bit of xml results in a memory leak from the xml
parser:

const char *xmlbuffer="<?xml version=\"1.0\" encoding=\"utf-8\"?>
<root xmlns=\"urn:schemas-upnp-org:device-1-0\" xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">
<dlna:X_DLNADOC xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">DMS-1.50</dlna:X_DLNADOC></root>";

When I execute the following code:

IXML_Document *doc = ixmlParseBuffer(xmlbuffer);
ixmlDocument_free(doc);

It results in a memory leak in ixmlparser.c line 2107 where it calls
safe_strdup( newElement->namespaceURI ); It's difficult to figure out why.
(cherry picked from commit d6f1e4112e)
2012-03-05 17:01:26 -03:00
Fabrice Fontaine
b4cc5df288 SF Bug Tracker id 3495616 - Memory leak in ixmlElement_setAttributeNS
Submitted: Fabrice Fontaine ( ffontaine ) - 2012-02-29 02:09:43 PST

newAttrNode is not freed if newAttr->n.nodeValue = strdup(value); returns
NULL or if ixmlElement_setAttributeNodeNS(element, newAttr, NULL) does
not return IXML_SUCCESS.
(cherry picked from commit a79a149e6a)
2012-03-05 10:33:30 -03:00
Fabrice Fontaine
b441c6f4a8 SF Bug Tracker id 3495280 - Memory leak in ixmlDocument_createElementEx
Submitted: Fabrice Fontaine ( ffontaine ) - 2012-02-28 04:01:02 PST

There is a memory leak in ixmlDocument_createElementEx:
newElement->tagName is not freed if
newElement->n.nodeName = strdup(tagName); returns NULL.
(cherry picked from commit 076f8e5be6)
2012-03-05 10:33:30 -03:00
Iain Denniston
bbe6d49b46 Fix for memory leak
(cherry picked from commit 8aca337de7)
2011-03-11 18:35:30 -03:00
Marcelo Roberto Jimenez
57b1169850 samples: Fix compiler warnings. 2010-11-17 12:01:04 -02:00
Marcelo Roberto Jimenez
297d2ae877 ixml: Fix for compiler warnings for size_t and ptrdiff_t.
ixmlparser.c static functions have been reordered.
(cherry picked from commit 58c694f57d)
2010-11-16 03:15:49 -02:00
Marcelo Roberto Jimenez
e6d7eb7767 2010-09-10 Jean Sigwald <jean.sigwald(at)orange-ftgroup.com>
I discovered a reliable denial-of-service issue on the last stable
release of libupnp (1.6.6) remotely triggerable by any
unauthenticated user. The issue is related with a bad parsing of
malformed XML.
(cherry picked from commit 25a4bd6d25)
2010-09-10 19:51:54 -03:00
Marcelo Roberto Jimenez
a627df4d10 SF Patch Tracker [ 2987390 ] upnp_debug vs. ixml_debug
Thanks for the load of updates, I'm still assimilating them ! Could I make
	a suggestion though? The addition of printNodes(IXML_Node) to upnpdebug a
	dds a new dependency on ixml.h for anything using upnpdebug.h. I'm making
	quite a bit of use of upnpdebug in porting things to version 1.8.0, and I'd
	prefer it if printNodes could be added to ixmldebug.h instead. I'm attach
	ing a patch, what do you think ?

	Nick



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@532 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2010-04-16 13:38:06 +00:00
Marcelo Roberto Jimenez
f00392e678 Duplicated definition of ixmlAttr_free(). MSVC compiler is complaining.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@451 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-07-16 22:22:56 +00:00
Marcelo Roberto Jimenez
46bc551a48 Undoing the patch that fixed this problem. In fact, there was no
problem and the patch was wrong.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@442 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-13 19:15:25 +00:00
Marcelo Roberto Jimenez
087e675c94 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@441 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-13 19:03:48 +00:00
Marcelo Roberto Jimenez
11a4ce7359 Improove debugging.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@440 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-13 19:00:52 +00:00
Marcelo Roberto Jimenez
a6ba868e58 Avoid a dangling pointer.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@439 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-12 13:58:08 +00:00
Marcelo Roberto Jimenez
9f96b04831 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@438 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-12 13:47:16 +00:00
Marcelo Roberto Jimenez
f00752efbd Doxygen and include file reorganization.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@430 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-09 23:19:00 +00:00
Marcelo Roberto Jimenez
3d7b653426 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@427 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-09 03:24:01 +00:00
Marcelo Roberto Jimenez
0f2463f739 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@426 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-09 02:31:24 +00:00
Marcelo Roberto Jimenez
680db7c78d Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@425 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-07 23:43:45 +00:00
Marcelo Roberto Jimenez
a9064dc0ca White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@424 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-06 22:33:43 +00:00
Marcelo Roberto Jimenez
aa63ef88f1 Removed all #include's from ixml.h.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@422 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-06 22:19:14 +00:00
Marcelo Roberto Jimenez
517965c946 DOMString use consistency.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@416 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 23:44:12 +00:00
Marcelo Roberto Jimenez
767eac1050 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@415 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 23:14:45 +00:00
Marcelo Roberto Jimenez
00e047f3c8 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@413 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 22:58:07 +00:00
Marcelo Roberto Jimenez
0ea80ee482 Fixed the ixml document tree printing routine to output the namespace tag.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@412 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 22:52:11 +00:00
Marcelo Roberto Jimenez
23260a7df1 Doxygen/debugging.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@411 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 22:23:18 +00:00
Marcelo Roberto Jimenez
2a4701328c Improoving debug in ixml.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@410 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 21:43:21 +00:00
Marcelo Roberto Jimenez
0e7e47d5bd Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@409 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 21:29:13 +00:00
Marcelo Roberto Jimenez
92f4a78ffa In the debug code, do not consider IXML_FILE_DONE as an error.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@405 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-03 19:56:15 +00:00
Marcelo Roberto Jimenez
4beacd4c2d Improoving debug in the parser. Seems like the ixml parser is only able to parse UTF-8.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@388 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-24 22:48:59 +00:00
Marcelo Roberto Jimenez
0e51ee5b61 White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@387 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-24 21:02:01 +00:00
Marcelo Roberto Jimenez
35db3e9bba Header file reordering and sanity. White space patch.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@384 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-23 21:55:04 +00:00
Charles Nepveu
98e2b2b3af Fixed the Visual Studio project file (ixml project):
- Added include directory "..\inc" where the autoconfig.h is relatively positionned.
Removed the #ifdef statement in ixmldebug.c file because now MSVC finds the autoconfig.h file.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@383 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-23 19:22:20 +00:00
Charles Nepveu
0eba550da0 - Fixed the windows VS2005 project for release and debug.
- Fixed the win32 inclusion of "netinet/net.h" -> "ws2tcpip.h"
- Fixed thread ID cast.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@381 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-22 20:00:37 +00:00
Marcelo Roberto Jimenez
9a98f25b95 Improoving IXML debugging.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@378 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-08 17:21:59 +00:00
Marcelo Roberto Jimenez
4e6102d1c2 More doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@370 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-05 23:10:41 +00:00
Marcelo Roberto Jimenez
a732d1a62e Typo in comment.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@346 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-04-23 19:03:19 +00:00
Marcelo Roberto Jimenez
84cb69fc2d White spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@336 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-03-22 17:21:43 +00:00
Marcelo Roberto Jimenez
0ea632f699 UPNP_INLINE is not needed in ixmlmembuf.h
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@272 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-12-17 10:40:42 +00:00
Marcelo Roberto Jimenez
8faf828b50 Added some assertions to the Parser_isValidEndElement() function. A user has
reported NULL pointers here, so lets check them on debug versions.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@269 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-12-17 00:37:41 +00:00
Marcelo Roberto Jimenez
44b8ee0b3a Added some comments and white spaces.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@268 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-12-17 00:03:06 +00:00
Marcelo Roberto Jimenez
81635d74c1 * More MSVC fixes, using XINLINE instead of inline, MSVC has troubles
with inline. Thanks to David Maass for reporting.
* Changed XINLINE to UPNP_INLINE.
* Lots of white space changes.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@192 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-05-23 13:20:55 +00:00
Marcelo Roberto Jimenez
cab8e4f799 SF Tracker [ 1628590 ] XML parsing segfault patch
Submitted By: 
Fredrik Svensson - svefredrik

This patch fixes a segmentation fault problem that occurrs when parsing
XML code than some routers produce.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@120 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-09 12:42:41 +00:00
Marcelo Roberto Jimenez
ae7ca6a2cf SF Tracker [ 1628552 ] XML white space patch
Submitted By: 
Fredrik Svensson - svefredrik

A few modifications to the patch were made:
1) Do not introduce new CRLF's where there were none.
2) Applied the same original idea to two other palces in soap_ctrlpt.c.



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@114 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2007-01-06 14:18:18 +00:00
Marcelo Roberto Jimenez
3b12ced1f8 SF Patch tracker [ 1587272 ] const-ified ixml
Submitted By: Erik Johansson



git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@105 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 21:30:32 +00:00
Marcelo Roberto Jimenez
353a876a54 SF Bug Tracker [ 1590466 ] Invalid xml output
Submitted By:
Erik Johansson - erijo


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@99 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 20:04:20 +00:00
Marcelo Roberto Jimenez
2bc6a1f8dd SF Bug tracker [ 1590469 ]
Typo in ixmlparser.c
Submitted By:
Erik Johansson - erijo


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@97 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-12-23 19:54:01 +00:00
Marcelo Roberto Jimenez
89e7a40fcc Removing unnecessary additional directory level.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@29 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2006-07-04 02:44:17 +00:00