summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-20 10:35:24 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-21 13:06:28 +0200
commit7716eb9095840e841fbd1af4b245664ac95edf6f (patch)
tree51a223e4b72b5baa5c6b354ca8564e14e23b2ccf
parent104341b05128407d5d50b3677eedb7bd34eece86 (diff)
downloadmupdf-7716eb9095840e841fbd1af4b245664ac95edf6f.tar.xz
Fix potential segfault when mapping JS strings to PDF.
-rw-r--r--source/tools/murun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 2e11014e..2f3d7e64 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -521,7 +521,7 @@ static pdf_obj *ffi_toobj(js_State *J, pdf_document *pdf, int idx)
if (js_isstring(J, idx)) {
const char *s = js_tostring(J, idx);
fz_try(ctx)
- if (s[0] == '(')
+ if (s[0] == '(' && s[1] != 0)
obj = pdf_new_string(ctx, pdf, s+1, strlen(s)-2);
else
obj = pdf_new_name(ctx, pdf, s);