| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <!-- Issue 42 from the Native Client security contest --> | 2 <!-- Issue 42 from the Native Client security contest --> |
| 3 <head> | 3 <head> |
| 4 <title>Native Client Security Contest -- Issue 42</title> | 4 <title>Native Client Security Contest -- Issue 42</title> |
| 5 </head> | 5 </head> |
| 6 <script type="application/x-javascript"> | 6 <script type="application/x-javascript"> |
| 7 var server; | 7 var server; |
| 8 var timeout; | 8 var timeout; |
| 9 var PostInit = function() { | 9 var PostInit = function() { |
| 10 server = document.getElementById('nacl_server'); | 10 server = document.getElementById('nacl_server'); |
| 11 if (server.__moduleReady == undefined) { | 11 if (server.__moduleReady == undefined) { |
| 12 timeout = setTimeout(PostInit, 100); | 12 timeout = setTimeout(PostInit, 100); |
| 13 return; | 13 return; |
| 14 } | 14 } |
| 15 var buttonid = document.getElementById("mybutton"); | 15 var buttonid = document.getElementById("mybutton"); |
| 16 buttonid.disabled = null; | 16 buttonid.disabled = null; |
| 17 } | 17 } |
| 18 var ClearTimeout = function() { | 18 var ClearTimeout = function() { |
| 19 clearTimeout(timeout); | 19 clearTimeout(timeout); |
| 20 } | 20 } |
| 21 var SocketAddressNaClToBrowser = function() { | 21 var SocketAddressNaClToBrowser = function() { |
| 22 var socket_address2 = server.start_server(); | 22 var socket_address2 = server.start_server(); |
| 23 var con_sock = socket_address2.connect(); | 23 var con_sock = socket_address2.connect(); |
| 24 alert('about to boom!'); | 24 alert('about to boom!'); |
| 25 var retval = con_sock.getmsg(-1); | 25 var retval = con_sock.getmsg(-1); |
| 26 } | 26 } |
| 27 </script> | 27 </script> |
| 28 <body onload="PostInit();" onunload="ClearTimeout();"> | 28 <body onload="PostInit();" onunload="ClearTimeout();"> |
| 29 <embed type="application/x-nacl-srpc" id="nacl_server" | 29 <embed type="application/x-nacl-srpc" id="nacl_server" |
| 30 width="0" height="0" src="srpc_nrd_server.nexe" /> | 30 width="0" height="0" nexe="srpc_nrd_server"> |
| 31 <button type="button" id="mybutton" disabled="true" | 31 <noembed> |
| 32 onclick="SocketAddressNaClToBrowser();"> | 32 Your browser does not appear to support Native Client. |
| 33 Visit http://code.google.com/p/nativeclient/ to get started. |
| 34 <noembed/> |
| 35 </embed> |
| 36 <button type="button" id="mybutton" disabled="true" |
| 37 onclick="SocketAddressNaClToBrowser();"> |
| 33 Crash me | 38 Crash me |
| 34 </button> | 39 </button> |
| 35 <p> | 40 <p> |
| 36 <b>Note:</b> For the purposes of contest issue #42, the actual expected | 41 <b>Note:</b> For the purposes of contest issue #42, the actual expected |
| 37 result when clicking the "Crash me" button is a browser that continues | 42 result when clicking the "Crash me" button is a browser that continues |
| 38 to operate properly. | 43 to operate properly. |
| 39 </p> | 44 </p> |
| 40 </body> | 45 </body> |
| 41 </html> | 46 </html> |
| OLD | NEW |