<?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>49342</bug_id>
          
          <creation_ts>2010-11-10 13:49:11 -0800</creation_ts>
          <short_desc>[Qt] QWebScriptWorld::world() may crash</short_desc>
          <delta_ts>2010-11-11 06:51:07 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Qt</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</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>Minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Yi Shen">max.hong.shen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>kling</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>307529</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Shen">max.hong.shen</who>
    <bug_when>2010-11-10 13:49:11 -0800</bug_when>
    <thetext>It might be trivial but we&apos;d better check the value of the private data in the QWebScriptWorld::world() to prevent the possible crash -- &apos;d&apos; may have an empty data if USE(JSC) is undefined for some platform.

QWebScriptWorld::QWebScriptWorld()
{
#if USE(JSC) // d can have an empty data if this macro fails
    d = new QWebScriptWorldPrivate(ScriptController::createWorld());    
#endif
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307532</commentid>
    <comment_count>1</comment_count>
      <attachid>73536</attachid>
    <who name="Yi Shen">max.hong.shen</who>
    <bug_when>2010-11-10 13:52:18 -0800</bug_when>
    <thetext>Created attachment 73536
first try</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307786</commentid>
    <comment_count>2</comment_count>
      <attachid>73536</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-11-11 01:34:23 -0800</bug_when>
    <thetext>Comment on attachment 73536
first try

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

&gt; WebKit/qt/Api/qwebscriptworld.cpp:53
&gt; +    return d.data() ? d-&gt;world.get() : NULL;

huh? how does world depend on data() ? Also we do not use NULL in C++ code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307803</commentid>
    <comment_count>3</comment_count>
      <attachid>73593</attachid>
    <who name="Yi Shen">max.hong.shen</who>
    <bug_when>2010-11-11 03:07:43 -0800</bug_when>
    <thetext>Created attachment 73593
second try</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307805</commentid>
    <comment_count>4</comment_count>
    <who name="Yi Shen">max.hong.shen</who>
    <bug_when>2010-11-11 03:10:32 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 73536 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=73536&amp;action=review
&gt; 
&gt; &gt; WebKit/qt/Api/qwebscriptworld.cpp:53
&gt; &gt; +    return d.data() ? d-&gt;world.get() : NULL;
&gt; 
&gt; huh? how does world depend on data() ? Also we do not use NULL in C++ code.

Thanks, you are right. I updated my patch, which returns 0 when the internal pointer to the shared data object is not null.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307806</commentid>
    <comment_count>5</comment_count>
      <attachid>73593</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-11-11 03:11:25 -0800</bug_when>
    <thetext>Comment on attachment 73593
second try

This is a purely artificial problem since we always build with USE(JSC) and the V8 port will most likely require large changes to QWebScriptWorld anyway.
That said, I don&apos;t see any harm in adding this check. r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307891</commentid>
    <comment_count>6</comment_count>
      <attachid>73593</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-11-11 06:51:01 -0800</bug_when>
    <thetext>Comment on attachment 73593
second try

Clearing flags on attachment: 73593

Committed r71818: &lt;http://trac.webkit.org/changeset/71818&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>307892</commentid>
    <comment_count>7</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-11-11 06:51:07 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>73536</attachid>
            <date>2010-11-10 13:52:18 -0800</date>
            <delta_ts>2010-11-11 03:07:43 -0800</delta_ts>
            <desc>first try</desc>
            <filename>49342.patch</filename>
            <type>text/plain</type>
            <size>969</size>
            <attacher name="Yi Shen">max.hong.shen</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9xdC9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViS2l0L3F0L0NoYW5n
ZUxvZwkocmV2aXNpb24gNzE3NjkpCisrKyBXZWJLaXQvcXQvQ2hhbmdlTG9nCSh3b3JraW5nIGNv
cHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMTAtMTEtMTAgIFlpIFNoZW4gIDx5aS40LnNoZW5Abm9r
aWEuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAg
IFtRdF0gUVdlYlNjcmlwdFdvcmxkOjp3b3JsZCgpIG1heSBjcmFzaAorICAgICAgICBodHRwczov
L2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NDkzNDIKKworICAgICAgICAqIEFwaS9x
d2Vic2NyaXB0d29ybGQuY3BwOgorICAgICAgICAoUVdlYlNjcmlwdFdvcmxkOjp3b3JsZCk6CisK
IDIwMTAtMTEtMTAgIFNoZXJpZmYgQm90ICA8d2Via2l0LnJldmlldy5ib3RAZ21haWwuY29tPgog
CiAgICAgICAgIFVucmV2aWV3ZWQsIHJvbGxpbmcgb3V0IHI3MTczMy4KSW5kZXg6IFdlYktpdC9x
dC9BcGkvcXdlYnNjcmlwdHdvcmxkLmNwcAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBXZWJLaXQvcXQvQXBpL3F3
ZWJzY3JpcHR3b3JsZC5jcHAJKHJldmlzaW9uIDcxNzU5KQorKysgV2ViS2l0L3F0L0FwaS9xd2Vi
c2NyaXB0d29ybGQuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC01MCw3ICs1MCw3IEBAIFFXZWJTY3Jp
cHRXb3JsZCAmUVdlYlNjcmlwdFdvcmxkOjpvcGVyYXQKIAogRE9NV3JhcHBlcldvcmxkKiBRV2Vi
U2NyaXB0V29ybGQ6OndvcmxkKCkgY29uc3QKIHsKLSAgICByZXR1cm4gZC0+d29ybGQuZ2V0KCk7
CisgICAgcmV0dXJuIGQuZGF0YSgpID8gZC0+d29ybGQuZ2V0KCkgOiBOVUxMOwogfQogCiAvKiEK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>73593</attachid>
            <date>2010-11-11 03:07:43 -0800</date>
            <delta_ts>2010-11-11 06:51:01 -0800</delta_ts>
            <desc>second try</desc>
            <filename>49342.patch</filename>
            <type>text/plain</type>
            <size>990</size>
            <attacher name="Yi Shen">max.hong.shen</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9xdC9DaGFuZ2VMb2cNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09P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vcmxkKCkgY29uc3QNCiB7DQot
ICAgIHJldHVybiBkLT53b3JsZC5nZXQoKTsNCisgICAgcmV0dXJuIGQgPyBkLT53b3JsZC5nZXQo
KSA6IDA7DQogfQ0KIA0KIC8qIQ0K
</data>

          </attachment>
      

    </bug>

</bugzilla>