summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-09-17 21:09:24 +0800
committerSebastian Rasmussen <sebras@gmail.com>2016-09-18 12:42:39 +0800
commit1823fa3855893d3352d29c16edd8d3c16749983c (patch)
tree43f7473e70616cbd7c1500fe4921a308ef83e18c /source
parent6c170bfbf597eee8fe9b749f834ae9fe8841d454 (diff)
downloadmupdf-1823fa3855893d3352d29c16edd8d3c16749983c.tar.xz
svg: Ensure that read svg file is null-terminated.
fz_parse_xml() assumes a null-terminated xml string.
Diffstat (limited to 'source')
-rw-r--r--source/svg/svg-doc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/svg/svg-doc.c b/source/svg/svg-doc.c
index 5404eefa..2216ad48 100644
--- a/source/svg/svg-doc.c
+++ b/source/svg/svg-doc.c
@@ -112,7 +112,10 @@ svg_open_document_with_stream(fz_context *ctx, fz_stream *file)
buf = fz_read_all(ctx, file, 0);
fz_try(ctx)
+ {
+ fz_write_buffer_byte(ctx, buf, 0);
doc = svg_open_document_with_buffer(ctx, buf);
+ }
fz_always(ctx)
fz_drop_buffer(ctx, buf);
fz_catch(ctx)