<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Plugin process crashes in NPN_InvokeDefault"
   href="https://bugs.webkit.org/show_bug.cgi?id=137425#c29">Comment # 29</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Plugin process crashes in NPN_InvokeDefault"
   href="https://bugs.webkit.org/show_bug.cgi?id=137425">bug 137425</a>
              from <span class="vcard"><a class="email" href="mailto:cgarcia&#64;igalia.com" title="Carlos Garcia Campos &lt;cgarcia&#64;igalia.com&gt;"> <span class="fn">Carlos Garcia Campos</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=137425#c28">comment #28</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=293400&amp;action=diff" name="attach_293400" title="Updated patch">attachment 293400</a> <a href="attachment.cgi?id=293400&amp;action=edit" title="Updated patch">[details]</a></span>
&gt; Updated patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=293400&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=293400&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:171
&gt; &gt; +    if (!npp || !o || !o-&gt;_class || !o-&gt;_class-&gt;invokeDefault)
&gt; &gt; +        return false;
&gt; 
&gt; This is a change in behavior. Before we would return true with a void value
&gt; in result when the invokeDefault pointer was null. I don’t see any test
&gt; coverage for this change in behavior.</span >

Yes, this is not covered by tests, I'm afraid, I just copied the early return condition from firefox, but only null npp and null npobject is covered by the tests (I think, I'll check anyway).

<span class="quote">&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:173
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; This is broken now, because invokeDefault is null in NPScriptObjectClass, so
&gt; this code will never run. No test coverage?</span >

Ah, I didn't notice that. 

<span class="quote">&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:213
&gt; &gt; +    if (!npp || !o || !o-&gt;_class || !o-&gt;_class-&gt;invoke)
&gt; &gt; +        return false;
&gt; 
&gt; This is a change in behavior. Before we would return true with a void value
&gt; for result when the invoke pointer was null. I don’t see any test coverage
&gt; for this change in behavior.
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:215
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; Also broken like the other case above.
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:293
&gt; &gt; +    if (!npp || !o || !o-&gt;_class || !o-&gt;_class-&gt;getProperty)
&gt; &gt; +        return false;
&gt; 
&gt; This is a change in behavior. Before we would set result to a void value
&gt; when the getProperty pointer was null. Maybe we should test this?
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:295
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; Also broken like the other cases above.
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:322
&gt; &gt; -    if (o-&gt;_class-&gt;hasProperty &amp;&amp; o-&gt;_class-&gt;getProperty) {
&gt; &gt; -        if (o-&gt;_class-&gt;hasProperty(o, propertyName))
&gt; &gt; -            return o-&gt;_class-&gt;getProperty(o, propertyName, variant);
&gt; &gt; -        return false;
&gt; &gt; -    }
&gt; &gt; +    if (o-&gt;_class-&gt;hasProperty(o, propertyName))
&gt; &gt; +        return o-&gt;_class-&gt;getProperty(o, propertyName, variant);
&gt; 
&gt; Why is it OK to drop the check of o-&gt;_class-&gt;hasProperty for null? Do we
&gt; have a test case covering that?</span >

I went too fast and thought this was only checking getProperty and removed the if because getProperty was already null checked before.

<span class="quote">&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:333
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; Also broken like the other cases above.
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:408
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; Also broken like the other cases above.
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:441
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; Also broken like the other cases above.
&gt; 
&gt; &gt; Source/WebCore/bridge/NP_jsobject.cpp:522
&gt; &gt;      if (o-&gt;_class == NPScriptObjectClass) {
&gt; 
&gt; Also broken like the other cases above.</span >

I'll update the patch.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>