<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>114450</bug_id>
          
          <creation_ts>2013-04-11 09:37:51 -0700</creation_ts>
          <short_desc>Default Implementation of toString for NPObject shouldn&apos;t return NPClass &amp; NPObject address as String</short_desc>
          <delta_ts>2013-04-11 22:18:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Arunprasad Rajkumar">arurajku</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>ararunprasad</cc>
    
    <cc>commit-queue</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>873938</commentid>
    <comment_count>0</comment_count>
    <who name="Arunprasad Rajkumar">arurajku</who>
    <bug_when>2013-04-11 09:37:51 -0700</bug_when>
    <thetext>JSValue CInstance::stringValue(ExecState* exec) const
{
    JSValue value;
    if (toJSPrimitive(exec, &quot;toString&quot;, value))
        return value;

    // Fallback to default implementation.
    char buf[1024];
    snprintf(buf, sizeof(buf), &quot;NPObject %p, NPClass %p&quot;, _object, _object-&gt;_class);
    return jsString(exec, buf);
}

In the above toString() default implementation, it leaks address of NPObject &amp; NPClass to JS, it should be something like below,

JSValue CInstance::stringValue(ExecState* exec) const
{
    JSValue value;
    if (toJSPrimitive(exec, &quot;toString&quot;, value))
        return value;

    // Fallback to default implementation.
    return jsString(exec, &quot;NPObject&quot;);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>873960</commentid>
    <comment_count>1</comment_count>
      <attachid>197633</attachid>
    <who name="Arunprasad Rajkumar">arurajku</who>
    <bug_when>2013-04-11 10:04:42 -0700</bug_when>
    <thetext>Created attachment 197633
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>873996</commentid>
    <comment_count>2</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-11 11:17:48 -0700</bug_when>
    <thetext>The commit-queue encountered the following flaky tests while processing attachment 197633:

svg/custom/empty-clip-path.svg bug 114453 (author: rwlbuis@gmail.com)
The commit-queue is continuing to process your patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>873997</commentid>
    <comment_count>3</comment_count>
      <attachid>197633</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-11 11:18:38 -0700</bug_when>
    <thetext>Comment on attachment 197633
Patch

Rejecting attachment 197633 from commit-queue.

Failed to run &quot;[&apos;/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch&apos;, &apos;--status-host=webkit-queues.appspot.com&apos;, &apos;--bot-id=webkit-cq-02&apos;, &apos;land-attachment&apos;, &apos;--force-clean&apos;, &apos;--non-interactive&apos;, &apos;--parent-command=commit-queue&apos;, 197633, &apos;--port=mac&apos;]&quot; exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
    -&gt; origin/master
Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ...
Currently at 148214 = 820de4ece1da437818b95493f95a9bd02d45ac22
r148215 = 2bf34076aea6c98a56cb3985fb0255efc93faac2
r148216 = 39af3eace1316d74ce17e04bdd5c449fcf51da8d
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.

Full output: http://webkit-queues.appspot.com/results/19114</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874015</commentid>
    <comment_count>4</comment_count>
      <attachid>197650</attachid>
    <who name="Arunprasad Rajkumar">arurajku</who>
    <bug_when>2013-04-11 12:02:07 -0700</bug_when>
    <thetext>Created attachment 197650
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874041</commentid>
    <comment_count>5</comment_count>
      <attachid>197650</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-11 12:35:55 -0700</bug_when>
    <thetext>Comment on attachment 197650
Patch

Clearing flags on attachment: 197650

Committed r148224: &lt;http://trac.webkit.org/changeset/148224&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874042</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2013-04-11 12:35:56 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874056</commentid>
    <comment_count>7</comment_count>
      <attachid>197650</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2013-04-11 12:47:03 -0700</bug_when>
    <thetext>Comment on attachment 197650
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=197650&amp;action=review

&gt; Source/WebCore/bridge/c/c_instance.cpp:285
&gt; +    return jsString(exec, &quot;NPObject&quot;);

This should be calling jsNontrivialString rather than jsString.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>874354</commentid>
    <comment_count>8</comment_count>
    <who name="Arunprasad Rajkumar">arurajku</who>
    <bug_when>2013-04-11 22:18:57 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 197650 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=197650&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/bridge/c/c_instance.cpp:285
&gt; &gt; +    return jsString(exec, &quot;NPObject&quot;);
&gt; 
&gt; This should be calling jsNontrivialString rather than jsString.

jsNontrivialString(exec, String(ASCIILiteral(&quot;NPObject&quot;)) is ok?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>197633</attachid>
            <date>2013-04-11 10:04:42 -0700</date>
            <delta_ts>2013-04-11 12:01:57 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-114450-20130411223359.patch</filename>
            <type>text/plain</type>
            <size>1329</size>
            <attacher name="Arunprasad Rajkumar">arurajku</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE0ODIxMykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE1IEBACisyMDEzLTA0LTExICBBcnVucHJh
c2FkIFJhamt1bWFyICA8YXJ1bnByYXNhZHJAbmRzLmNvbT4KKworICAgICAgICBEZWZhdWx0IElt
cGxlbWVudGF0aW9uIG9mIHRvU3RyaW5nIGZvciBOUE9iamVjdCBzaG91bGRuJ3QgcmV0dXJuIE5Q
Q2xhc3MgJiBOUE9iamVjdCBhZGRyZXNzIGFzIFN0cmluZworICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTE0NDUwCisKKyAgICAgICAgUmV2aWV3ZWQgYnkg
Tk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgTm8gbmV3IHRlc3RzIChPT1BTISkuCisKKyAgICAg
ICAgK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XRlKikgY29uc3QK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>197650</attachid>
            <date>2013-04-11 12:02:07 -0700</date>
            <delta_ts>2013-04-11 12:47:03 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-114450-20130412003124.patch</filename>
            <type>text/plain</type>
            <size>1296</size>
            <attacher name="Arunprasad Rajkumar">arurajku</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE0ODIxMykKKysrIFNvdXJjZS9XZWJDb3JlL0NoYW5n
ZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDEzIEBACisyMDEzLTA0LTExICBBcnVucHJh
c2FkIFJhamt1bWFyICA8YXJ1bnByYXNhZHJAbmRzLmNvbT4KKworICAgICAgICBEZWZhdWx0IElt
cGxlbWVudGF0aW9uIG9mIHRvU3RyaW5nIGZvciBOUE9iamVjdCBzaG91bGRuJ3QgcmV0dXJuIE5Q
Q2xhc3MgJiBOUE9iamVjdCBhZGRyZXNzIGFzIFN0cmluZworICAgICAgICBodHRwczovL2J1Z3Mu
d2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTE0NDUwCisKKyAgICAgICAgUmV2aWV3ZWQgYnkg
Tk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBicmlkZ2UvYy9jX2luc3RhbmNlLmNwcDoKKyAg
ICAgICAgKEpTQzo6QmluZGluZ3M6OkNJbnN0YW5jZTo6c3RyaW5nVmFsdWUpOgorCiAyMDEzLTA0
LTExICBBbGxhbiBTYW5kZmVsZCBKZW5zZW4gIDxhbGxhbi5qZW5zZW5AZGlnaWEuY29tPgogCiAg
ICA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