shithub: libmujs

Download patch

ref: 46b9d8c7e779f9cee7ae636daa8acd320e261aba
parent: eed403069fbd52d3d5cada6d504039f4ac3f5949
author: Tor Andersson <tor@ccxvii.net>
date: Wed Mar 12 10:42:22 EDT 2014

Check that operand to 'in' is an object (no implicit conversion).

--- a/jsrun.c
+++ b/jsrun.c
@@ -1159,6 +1159,8 @@
 
 		case OP_IN:
 			str = js_tostring(J, -2);
+			if (!js_isobject(J, -1))
+				js_typeerror(J, "operand to 'in' is not an object");
 			b = js_hasproperty(J, -1, str);
 			js_pop(J, 2 + b);
 			js_pushboolean(J, b);