summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume@desmottes.be>2023-01-12 15:50:07 +0100
committerGuillaume Desmottes <guillaume@desmottes.be>2023-01-12 15:52:22 +0100
commitc009aefa3749f99fcbacac050ee3e0cf779be463 (patch)
tree983ba94e87c1c001d512029f4f06803a70556ed2
parentda3d4c9fc6959fc999c1cd1e3f66ffd8925574ec (diff)
downloadlibsoup-c009aefa3749f99fcbacac050ee3e0cf779be463.tar.gz
message: fix critical when trying to create a message from invalid URI
soup_message_new_from_uri() raises a critical if SOUP_URI_IS_VALID returns FALSE. This macro also checks if the URI host is not an empty string, which was not checked in the caller code. Fix critical when running such GStreamer pipeline: gst-launch-1.0 souphttpsrc location=http:///not-there.ogg ! fakesink
-rw-r--r--libsoup/soup-message.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsoup/soup-message.c b/libsoup/soup-message.c
index a7b7349c..4e6b28b9 100644
--- a/libsoup/soup-message.c
+++ b/libsoup/soup-message.c
@@ -976,7 +976,7 @@ soup_message_new (const char *method, const char *uri_string)
uri = g_uri_parse (uri_string, SOUP_HTTP_URI_FLAGS, NULL);
if (!uri)
return NULL;
- if (!g_uri_get_host (uri)) {
+ if (!SOUP_URI_IS_VALID (uri)) {
g_uri_unref (uri);
return NULL;
}