Changeset 42659 in webkit for trunk/JavaScriptCore/API


Ignore:
Timestamp:
Apr 19, 2009, 3:26:00 PM (16 years ago)
Author:
[email protected]
Message:

2009-04-19 Sam Weinig <[email protected]>

Reviewed by Dan Bernstein.

Fix for <rdar://problem/5860954>
Harden JSStringCreateWithCFString against malformed CFStringRefs.

  • API/JSStringRefCF.cpp: (JSStringCreateWithCFString):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSStringRefCF.cpp

    r39817 r42659  
    3939    JSC::initializeThreading();
    4040    CFIndex length = CFStringGetLength(string);
     41    if (length < 0)
     42        CRASH():
    4143    if (length) {
    4244        OwnArrayPtr<UniChar> buffer(new UniChar[length]);
Note: See TracChangeset for help on using the changeset viewer.