shithub: libmujs

Download patch

ref: e3f04e7f96b4f2852ca270b07f48690787a20252
parent: 11c894d0c1f8c1d919890d51d0fb85c57d6c6664
author: Tor Andersson <tor.andersson@artifex.com>
date: Thu Jan 30 07:46:51 EST 2020

Check for empty string in js_isarrayindex.

--- a/jsrun.c
+++ b/jsrun.c
@@ -445,6 +445,10 @@
 {
 	int n = 0;
 
+	/* check for empty string */
+	if (p[0] == 0)
+		return 0;
+
 	/* check for '0' and integers with leading zero */
 	if (p[0] == '0')
 		return (p[1] == 0) ? *idx = 0, 1 : 0;