Commit Graph

63 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
10cbc5a865 UTF-8. 2010-10-04 11:13:46 -03: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
4ebf890e92 Fix compilation error in ixml/inc/ixml.h when compiling with an
Objective-C compiler (when cross-compiling for iPhone devices).

Patch submitted by Chandra (inactiveneurons).
(cherry picked from commit b8e9628140)
2010-09-07 22:49:34 -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
cd6d5822fb Fixed a missing HandleUnlock() in upnp/src/gena/gena_device.c plus several
white space changes.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@464 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-07-25 03:27:42 +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
9ca32e0eb4 Removing replicated #defines and using a single source for them, UpnpGlobal.h.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@423 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-06 22:28:46 +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
ad8a223998 Doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@414 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 23:06:20 +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
3d78996c40 Updating Makefile.am for missing files in the "make dist" tarball.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@406 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-06-04 03:06:30 +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
263e616403 Some white spaces, some doxygen, some code reorganizing.
We should try to return only at the end of the function so that
we can use "objects" reliably.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@375 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-06 19:29:24 +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
9e54783740 More doxygen. It's a dirty job, but someone has to do it...
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@369 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-05 22:32:44 +00:00
Marcelo Roberto Jimenez
164dce7fc2 More doxygen.
git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@368 119443c7-1b9e-41f8-b6fc-b9c35fce742c
2008-05-05 00:25:22 +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