js/src/tests/js1_5/Regress/regress-303213.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 // |reftest| skip-if(!xulRuntime.shell||Android) -- bug 524731
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 //-----------------------------------------------------------------------------
     8 var BUGNUMBER = 303213;
     9 var summary = 'integer overflow in js';
    10 var actual = 'No Crash';
    11 var expect = 'No Crash';
    13 printBugNumber(BUGNUMBER);
    14 printStatus (summary);
    15 printStatus('This bug passes if no crash occurs');
    17 expectExitCode(0);
    18 expectExitCode(5);
    20 try
    21 {
    22   var s=String.fromCharCode(257);
    24   var ki="";
    25   var me="";
    26   for (i = 0; i < 1024; i++)
    27   {
    28     ki = ki + s;
    29   }
    31   for (i = 0; i < 1024; i++)
    32   {
    33     me = me + ki;
    34   }
    36   var ov = s;
    38   for (i = 0; i < 28; i++)
    39     ov += ov;
    41   for (i = 0; i < 88; i++)
    42     ov += me;
    44   printStatus("done generating");
    45   var eov = escape(ov);
    46   printStatus("done escape");
    47   printStatus(eov);
    48 }
    49 catch(ex)
    50 {
    51   // handle changed 1.9 branch behavior. see bug 422348
    52   expect = 'InternalError: allocation size overflow';
    53   actual = ex + '';
    54 }
    56 reportCompare(expect, actual, summary);

mercurial