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 746871 - bus: Segmentation fault in function gst_bus_set_flushing() when called with bus==NULL
bus: Segmentation fault in function gst_bus_set_flushing() when called with b...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-27 09:08 UTC by Prashant Gotarne
Modified: 2015-03-27 10:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstbus: Argument Verification in gst_bus_set_flushing() (767 bytes, patch)
2015-03-27 09:22 UTC, Prashant Gotarne
committed Details | Review

Description Prashant Gotarne 2015-03-27 09:08:27 UTC
Segmentation fault occured in function gst_bus_set_flushing() with NULL argument.
Comment 1 Sebastian Dröge (slomo) 2015-03-27 09:15:57 UTC
commit 2064a07feb8d7d1c0477a76c41dd12b4d49b7aff
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Fri Mar 27 10:15:16 2015 +0100

    bus: Add guards against invalid arguments to set_flushing() and poll()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746871
Comment 2 Sebastian Dröge (slomo) 2015-03-27 09:16:53 UTC
It's not safe to do that and will still result in a g_critical(). You should never call any object methods with NULL as the object instance.
Comment 3 Prashant Gotarne 2015-03-27 09:22:32 UTC
Created attachment 300422 [details] [review]
gstbus: Argument Verification in gst_bus_set_flushing()

Argument verification needed in function gst_bus_set_flushing() to avoid possible segmentation fault in case of NULL argument.
Comment 4 Sebastian Dröge (slomo) 2015-03-27 09:26:30 UTC
Comment on attachment 300422 [details] [review]
gstbus: Argument Verification in gst_bus_set_flushing()

Committed that fix (plus the same for poll()) some minutes ago already.
Comment 5 Tim-Philipp Müller 2015-03-27 10:39:39 UTC
Just to be clear, those checks are merely there to assist programmers in finding typical issues faster. There's no need to check every argument in every function. It is never valid to call these functions with those arguments, and these checks will be compiled out on embedded systems anyway.