Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-53672

Segfault when invalid object is passed as "this" to Array.prototype.join

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.3
    • 5.6.0
    • None
    • Mac OS X 10.11.4 Qt 5.6.0

      Not sure if this happens in earlier versions of Qt.
    • 3a45458b96bdcbccc189aabf668e998ea03be46f

    Description

      If you attempt to use call or apply on Array.prototype.join and use an invalid object as the this argument, Qt will segfault.

      Example:

      // Works fine with a normal array
      Array.prototype.join.call([0, 1]);
      
      // Works fine with this array-like object:
      Array.prototype.join.call({
        "length": 2,
        "0": 0,
        "1": 1
      });
      
      // Invalid, but will not cause a segfault
      Array.prototype.join.call(function(){});
      
      // Will cause a segfault
      Array.prototype.join.call(0);
      Array.prototype.join.call(null);
      Array.prototype.join.call(true);
      Array.prototype.join.call();
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            w00t Robin Burchell
            empyrical empyrical
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes