[libsoup] SoupURI: give "foo:" a non-NULL path member
- From: Simon McVittie <smcv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] SoupURI: give "foo:" a non-NULL path member
- Date: Fri, 3 Feb 2012 14:26:15 +0000 (UTC)
commit 672d2560b015855ab0350655ecae73f8045c2dc7
Author: Simon McVittie <simon mcvittie collabora co uk>
Date: Tue Jan 10 13:20:38 2012 +0000
SoupURI: give "foo:" a non-NULL path member
SoupURI documents uri->path as being required, and got_headers in
SoupServer assumes that it's non-NULL, but in fact parsing a URI
consisting solely of a scheme ("foo:") would leave path = NULL.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977
Signed-off-by: Simon McVittie <simon mcvittie collabora co uk>
Reviewed-by: Dan Winship <danw gnome org>
libsoup/soup-uri.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index cb7c5ce..1ece165 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -195,8 +195,10 @@ soup_uri_new_with_base (SoupURI *base, const char *uri_string)
uri_string = p + 1;
}
- if (uri_string == end && !base && !uri->fragment)
+ if (uri_string == end && !base && !uri->fragment) {
+ uri->path = g_strdup ("");
return uri;
+ }
/* Check for authority */
if (strncmp (uri_string, "//", 2) == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]