From 37a9b02391e468226498f26ae8922cea68bb6e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 2 May 2017 14:35:50 +0300 Subject: [PATCH] message: Don't pass a NULL debug string to g_utf8_validate() g_utf8_validate() crashes on NULL, but NULL is valid for the debug string nonetheless. --- gst/gstmessage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/gstmessage.c b/gst/gstmessage.c index a1d0d2657b..ee0de24ca4 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -415,7 +415,7 @@ gst_message_new_error_with_details (GstObject * src, GError * error, GstMessage *message; GstStructure *structure; - if (!g_utf8_validate (debug, -1, NULL)) { + if (debug && !g_utf8_validate (debug, -1, NULL)) { debug = NULL; g_warning ("Trying to set debug field of error message, but " "string is not valid UTF-8. Please file a bug."); @@ -507,7 +507,7 @@ gst_message_new_warning_with_details (GstObject * src, GError * error, GstMessage *message; GstStructure *structure; - if (!g_utf8_validate (debug, -1, NULL)) { + if (debug && !g_utf8_validate (debug, -1, NULL)) { debug = NULL; g_warning ("Trying to set debug field of warning message, but " "string is not valid UTF-8. Please file a bug."); @@ -597,7 +597,7 @@ gst_message_new_info_with_details (GstObject * src, GError * error, GstMessage *message; GstStructure *structure; - if (!g_utf8_validate (debug, -1, NULL)) { + if (debug && !g_utf8_validate (debug, -1, NULL)) { debug = NULL; g_warning ("Trying to set debug field of info message, but " "string is not valid UTF-8. Please file a bug.");