xbmc: readd tinyxml patches

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-10-09 23:39:47 +02:00
parent a31f7c7d4f
commit eaee4c297a
2 changed files with 8337 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
From c0409779940d74993669788ce0b01d257508a581 Mon Sep 17 00:00:00 2001
From: Joakim Plate <elupus@xbmc.org>
Date: Sun, 8 Jul 2012 01:06:05 +0200
Subject: [PATCH] [tinyxml] invalid reading of xml from FILE pointers
buf is not a null terminated string, so don't rely on it
---
xbmc/utils/XBMCTinyXML.cpp | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/xbmc/utils/XBMCTinyXML.cpp b/xbmc/utils/XBMCTinyXML.cpp
index 82e2451..707653c 100644
--- a/xbmc/utils/XBMCTinyXML.cpp
+++ b/xbmc/utils/XBMCTinyXML.cpp
@@ -91,12 +91,9 @@ bool CXBMCTinyXML::LoadFile(FILE *f, TiXmlEncoding encoding)
{
CStdString data("");
char buf[BUFFER_SIZE];
- int result, count = 0;
+ int result;
while ((result = fread(buf, 1, BUFFER_SIZE, f)) > 0)
- {
- data.reserve(BUFFER_SIZE * (++count));
- data.append(buf);
- }
+ data.append(buf, result);
return Parse(data, NULL, encoding) != NULL;
}
--
1.7.10