After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756861 - hlsdemux: crash / memory leak on broken (master) playlist
hlsdemux: crash / memory leak on broken (master) playlist
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-20 11:55 UTC by André Draszik
Modified: 2015-10-25 10:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
suggested fix (1.77 KB, patch)
2015-10-20 12:01 UTC, André Draszik
committed Details | Review

Description André Draszik 2015-10-20 11:55:47 UTC
hlsdemux: don't crash / leak memory on broken (master) playlist
    
    If a (master) playlist contains a variant list entry without a URI
    then during parsing of the next variant list entry we are
    a) leaking the entry we're currently parsing (new_list), and
    b) free'ing the pointer to the previous list entry (list) without
       updating the pointer.
    
    Hence when then adding the URI for the latest parsed entry, incorrect
    information is stored, as the information is used from 'list' which
    is not valid memory anymore, also leading to crashes.
    
    Fix this by correctly storing the new variant list entry pointer
    as needed.
Comment 1 André Draszik 2015-10-20 12:01:47 UTC
Created attachment 313738 [details] [review]
suggested fix
Comment 2 André Draszik 2015-10-20 12:02:10 UTC
The same code exists in the 1.6 and 1.4 gstreamer branches.
Comment 3 Tim-Philipp Müller 2015-10-25 10:57:26 UTC
Thanks, pushed:

commit 41ca1e48a0baa53354d3c9d0dd8679fab5fcfbb3
Author: Tim-Philipp Müller <tim@centricular.com>
Date:   Sun Oct 25 01:19:33 2015 +0100

    tests: hlsdemux_m3u: add test for master playlist with missing variant list uri
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756861

commit e0b4290998d9a95553b7b6ad732891e3d1c8cc5b
Author: André Draszik <git@andred.net>
Date:   Tue Oct 20 09:13:04 2015 +0100

    hlsdemux: don't crash or leak memory on broken master playlist
    
    If a (master) playlist contains a variant list entry without a
    URI then during parsing of the next variant list entry we are
    a) leaking the entry we're currently parsing (new_list), and
    b) free'ing the pointer to the previous list entry (list) without
       updating the pointer.
    
    Hence when then adding the URI for the latest parsed entry, incorrect
    information is stored, as the information is used from 'list' which
    is not valid memory anymore, also leading to crashes.
    
    Fix this by correctly storing the new variant list entry pointer
    as needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756861