Changeset 35049 in webkit


Ignore:
Timestamp:
Jul 7, 2008 4:51:56 PM (16 years ago)
Author:
cwzwarich@webkit.org
Message:

2008-07-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>

Reviewed by Geoff.

Bug 19907: REGRESSION(r34824-r34941): Reproducible crash trying to log in to MediaTemple.net Account Center
<https://bugs.webkit.org/show_bug.cgi?id=19907>

Clear exceptions set on ExecStates before returning from NPAPI
callbacks, in order to avoid causing problems for the next script that
executes.

While fixing this bug, the question was raised of whether we are
correctly propagating exception information back to the caller:

Bug 19936: Correctly propagate exception information from NPAPI callbacks
<https://bugs.webkit.org/show_bug.cgi?id=19936>

  • bridge/NP_jsobject.cpp: (_NPN_InvokeDefault): (_NPN_Invoke): (_NPN_Evaluate): (_NPN_GetProperty): (_NPN_SetProperty): (_NPN_RemoveProperty): (_NPN_HasProperty): (_NPN_HasMethod): (_NPN_Enumerate):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r35047 r35049  
     12008-07-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
     2
     3        Reviewed by Geoff.
     4
     5        Bug 19907: REGRESSION(r34824-r34941): Reproducible crash trying to log in to MediaTemple.net Account Center
     6        <https://bugs.webkit.org/show_bug.cgi?id=19907>
     7
     8        Clear exceptions set on ExecStates before returning from NPAPI
     9        callbacks, in order to avoid causing problems for the next script that
     10        executes.
     11
     12        While fixing this bug, the question was raised of whether we are
     13        correctly propagating exception information back to the caller:
     14
     15        Bug 19936: Correctly propagate exception information from NPAPI callbacks
     16        <https://bugs.webkit.org/show_bug.cgi?id=19936>
     17
     18        * bridge/NP_jsobject.cpp:
     19        (_NPN_InvokeDefault):
     20        (_NPN_Invoke):
     21        (_NPN_Evaluate):
     22        (_NPN_GetProperty):
     23        (_NPN_SetProperty):
     24        (_NPN_RemoveProperty):
     25        (_NPN_HasProperty):
     26        (_NPN_HasMethod):
     27        (_NPN_Enumerate):
     28
    1292008-07-07  Dan Bernstein  <mitz@apple.com>
    230
  • trunk/WebCore/bridge/NP_jsobject.cpp

    r35007 r35049  
    124124        // Convert and return the result of the function call.
    125125        convertValueToNPVariant(exec, resultV, result);
     126        exec->clearException();
    126127        return true;       
    127128    }
     
    172173        // Convert and return the result of the function call.
    173174        convertValueToNPVariant(exec, resultV, result);
     175        exec->clearException();
    174176        return true;
    175177    }
     
    209211
    210212        convertValueToNPVariant(exec, result, variant);
    211    
     213        exec->clearException();
    212214        return true;
    213215    }
     
    237239
    238240        convertValueToNPVariant(exec, result, variant);
     241        exec->clearException();
    239242        return true;
    240243    }
     
    266269        else
    267270            obj->imp->put(exec, i->value.number, convertNPVariantToValue(exec, variant, rootObject));
     271        exec->clearException();
    268272        return true;
    269273    }
     
    287291        PrivateIdentifier* i = static_cast<PrivateIdentifier*>(propertyName);
    288292        if (i->isString) {
    289             if (!obj->imp->hasProperty(exec, identifierFromNPIdentifier(i->value.string)))
     293            if (!obj->imp->hasProperty(exec, identifierFromNPIdentifier(i->value.string))) {
     294                exec->clearException();
    290295                return false;
     296            }
    291297        } else {
    292             if (!obj->imp->hasProperty(exec, i->value.number))
     298            if (!obj->imp->hasProperty(exec, i->value.number)) {
     299                exec->clearException();
    293300                return false;
     301            }
    294302        }
    295303
     
    299307        else
    300308            obj->imp->deleteProperty(exec, i->value.number);
    301        
     309
     310        exec->clearException();
    302311        return true;
    303312    }
     
    317326        PrivateIdentifier* i = static_cast<PrivateIdentifier*>(propertyName);
    318327        JSLock lock(false);
    319         if (i->isString)
    320             return obj->imp->hasProperty(exec, identifierFromNPIdentifier(i->value.string));
    321         return obj->imp->hasProperty(exec, i->value.number);
     328        if (i->isString) {
     329            bool result = obj->imp->hasProperty(exec, identifierFromNPIdentifier(i->value.string));
     330            exec->clearException();
     331            return result;
     332        }
     333
     334        bool result = obj->imp->hasProperty(exec, i->value.number);
     335        exec->clearException();
     336        return result;
    322337    }
    323338
     
    344359        JSLock lock(false);
    345360        JSValue* func = obj->imp->get(exec, identifierFromNPIdentifier(i->value.string));
     361        exec->clearException();
    346362        return !func->isUndefined();
    347363    }
     
    383399        *identifier = identifiers;
    384400        *count = size;
    385        
     401
     402        exec->clearException();
    386403        return true;
    387404    }
Note: See TracChangeset for help on using the changeset viewer.