GNOME Bugzilla – Bug 733757
GstURIHandlers which return NULL GErrors cause GStreamer to crash
Last modified: 2018-11-03 12:21:45 UTC
Created attachment 281720 [details] [review] gsturi.c patch If a GstURIHandler's set_uri() function sets the *error parameter to NULL, the code in gsturi.c will attempt a NULL pointer dereference if debug logging is enabled, thus causing a crash. Fixed by checking for a NULL pointer and printing an alternate text in this case.
Review of attachment 281720 [details] [review]: ::: gst/gsturi.c @@ +608,2 @@ GST_WARNING ("%s didn't accept URI '%s': %s", GST_OBJECT_NAME (ret), uri, + (uri_err != NULL) ? uri_err->message : "<GError variable NULL>"); If err is NULL this is a programming error in the element. Can you make that a g_warning() or g_critical()? Also we should fix the elements :)
Note that I just mean that there additionally should be a g_critical() :) It should still not crash
Okay. Note though that the documentation doesn't say anything about uri_err NULL being a programming error. What if there just is a general error and no details are available?
If a non-NULL GError** is passed to a function and the function fails, the error *must* be set. Can you update the patch accordingly to also do a g_critical() if that happens?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/68.