summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Burke <dan.p.burke@gmail.com>2011-09-09 21:59:32 +0930
committerDaniel Burke <dan.p.burke@gmail.com>2011-09-09 21:59:32 +0930
commitce859a2e6a12f093fbb978bc6ed011f10980f60a (patch)
tree898c4a60f1cfca3e449b2116a8f64f6ebc3ae560
parent1988b0b627787a897dcb0a0d5f782c23b50f6c15 (diff)
ttxml: zero terminate the buffer after checking it was allocated
-rw-r--r--ccan/ttxml/ttxml.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ccan/ttxml/ttxml.c b/ccan/ttxml/ttxml.c
index 03b101d6..e953ba23 100644
--- a/ccan/ttxml/ttxml.c
+++ b/ccan/ttxml/ttxml.c
@@ -337,10 +337,10 @@ XmlNode* xml_load(const char * filename)
return NULL;
xml.buf = malloc(BUFFER+1);
- xml.buf[BUFFER]=0;
- xml.len = BUFFER;
if(!xml.buf)
goto xml_load_fail_malloc_buf;
+ xml.buf[BUFFER]=0;
+ xml.len = BUFFER;
xml_read_file(&xml);