diff options
author | Andrew Azores <[email protected]> | 2013-10-24 10:11:37 -0400 |
---|---|---|
committer | Andrew Azores <[email protected]> | 2013-10-24 10:11:37 -0400 |
commit | 4d8cfe5bdb364fe3f4fca59c263dc1cdbd87e7e5 (patch) | |
tree | 7175edb5bf3e9941300560ebc3d8c3504312ef73 /tests/reproducers/simple/JSObjectWithoutToString/resources | |
parent | d124f6a22bbc74de7b95890642615cdf3eaa5029 (diff) |
Fix array index out of bounds due to malformed plugin message (PR539)
Failed calls to getString and getMember on JSObjects should not produce malformed
result strings. "null" is appended to result rather than empty string.
* plugin/icedteanp/IcedTeaPluginRequestProcessor.cc: (_getMember,
_getString) append "null" to result when call is unsuccessful
* tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html:
new test to ensure failed calls to getMember and getString on JSObject do
not produce malformed results
* tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js:
same
* tests/reproducers/simple/JSObjectWithoutToString/srcs/JSObjectWithoutToString.java:
same
* tests/reproducers/simple/JSObjectWithoutToString/testcases/JSObjectWithoutToStringTest.java:
same
Diffstat (limited to 'tests/reproducers/simple/JSObjectWithoutToString/resources')
-rw-r--r-- | tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html | 25 | ||||
-rw-r--r-- | tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js | 8 |
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html b/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html new file mode 100644 index 0000000..558d1b9 --- /dev/null +++ b/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.html @@ -0,0 +1,25 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en-US"> + <head> + <title>JavaScript to Java LiveConnect - Function return values from applet</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + + <script language="JavaScript" src="JSObjectWithoutToString.js"></script> + + </head> + <body> + + <h2> The JSObjectWithoutToString html page</h2> + + + <applet code="JSObjectWithoutToString" archive="JSObjectWithoutToString.jar" width="1000" height="100" id="jswithouttostring" MAYSCRIPT> + </applet> + + <div id="messageDiv"></div> + + <script laguage="javascript"> + doToStringTest(); + </script> + + </body> +</html> diff --git a/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js b/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js new file mode 100644 index 0000000..47d7d97 --- /dev/null +++ b/tests/reproducers/simple/JSObjectWithoutToString/resources/JSObjectWithoutToString.js @@ -0,0 +1,8 @@ +function doToStringTest(){ + var applet = document.getElementById('jswithouttostring'); + + var null_obj = Object.create(null); + + applet.callJSToString(null_obj); +} + |