Changeset 211401 in webkit


Ignore:
Timestamp:
Jan 30, 2017 6:38:07 PM (7 years ago)
Author:
jer.noble@apple.com
Message:

NULL-deref crash in TextTrack::removeCue()
https://bugs.webkit.org/show_bug.cgi?id=167615

Reviewed by Eric Carlson.

It's possible for a track to be removed which was never actually added to the cue list.
Specifically, if an in-band track with a negative start or end time was parsed, it would
have been rejected by TextTrack::addCue(). When it comes time to flush those in-band cues,
TextTrack::m_cues will still be NULL. Rather than ASSERT in this case, we should revert the
behavior added in r210319 and throw an exception.

  • html/track/TextTrack.cpp:

(WebCore::TextTrack::removeCue):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211399 r211401  
     12017-01-30  Jer Noble  <jer.noble@apple.com>
     2
     3        NULL-deref crash in TextTrack::removeCue()
     4        https://bugs.webkit.org/show_bug.cgi?id=167615
     5
     6        Reviewed by Eric Carlson.
     7
     8        It's possible for a track to be removed which was never actually added to the cue list.
     9        Specifically, if an in-band track with a negative start or end time was parsed, it would
     10        have been rejected by TextTrack::addCue(). When it comes time to flush those in-band cues,
     11        TextTrack::m_cues will still be NULL. Rather than ASSERT in this case, we should revert the
     12        behavior added in r210319 and throw an exception.
     13
     14        * html/track/TextTrack.cpp:
     15        (WebCore::TextTrack::removeCue):
     16
    1172017-01-30  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/WebCore/html/track/TextTrack.cpp

    r210319 r211401  
    334334    if (cue.track() != this)
    335335        return Exception { NOT_FOUND_ERR };
     336    if (!m_cues)
     337        return Exception { INVALID_STATE_ERR };
    336338
    337339    // 2. Remove cue from the method's TextTrack object's text track's text track list of cues.
    338     ASSERT(m_cues);
    339340    m_cues->remove(cue);
    340341    cue.setIsActive(false);
Note: See TracChangeset for help on using the changeset viewer.