<?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>149864</bug_id>
          
          <creation_ts>2015-10-06 17:41:48 -0700</creation_ts>
          <short_desc>Possible null pointer dereference in WebSocket::connect</short_desc>
          <delta_ts>2023-05-12 08:00:46 -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>Other</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>aestes</cc>
    
    <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>jiewen_tan</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>wilander</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1131174</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2015-10-06 17:41:48 -0700</bug_when>
    <thetext>I noticed this issue due to the fix for bug #149311.

Later down in WebSocket::connect() there is a call to document.frame()-&gt;loader().mixedContentChecker(). I don&apos;t see why that doesn&apos;t crash now, since it occurs if (is&lt;Document&gt;(*scriptExecutionContext()), the same condition as the null dereference of frame up above, which was problematic in bug #149311. That was &quot;safe&quot; when I added it because document.frame() was assumed to be nonnull up above, but clearly that was wrong and is now no longer the case.

I guess if it&apos;s not crashing (is it returning early on an error path?), then it might not be a problem, but it looks dangerous in light of this change... do we need to add a check to make sure frame is not null there? If so, do we need to rethink how to gain access to the mixed content checker, or is the content in a detached frame not going to be loaded? We need to be careful not to accidentally allow loading insecure content here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1954974</commentid>
    <comment_count>1</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-05-12 08:00:46 -0700</bug_when>
    <thetext>It looks like this has been refactored and frame is null-checked now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>