ref: 8c566e168ce54f61402356bbca47a3634517fa95
parent: 6fa0097d9ea62cc009bc365d1c12e5310c8127b3
author: Tor Andersson <tor.andersson@artifex.com>
date: Sat Nov 29 15:00:53 EST 2014
Fix bug in js_pushlstring.
--- a/jsrun.c
+++ b/jsrun.c
@@ -120,7 +120,8 @@
CHECKSTACK(1);
if (n < 16) {
STACK[TOP].type = JS_TSHRSTR;
- strcpy(STACK[TOP].u.shrstr, v);
+ memcpy(STACK[TOP].u.shrstr, v, n);
+ STACK[TOP].u.shrstr[n] = 0;
} else {
STACK[TOP].type = JS_TMEMSTR;
STACK[TOP].u.memstr = jsV_newmemstring(J, v, n);