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 588841 - crash in get_host_for_message() if uri->host is null
crash in get_host_for_message() if uri->host is null
Status: RESOLVED DUPLICATE of bug 528882
Product: libsoup
Classification: Core
Component: Misc
2.27.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2009-07-17 07:47 UTC by Lucian Langa
Modified: 2009-07-17 14:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
check uri->host in soup_uri_host_hash (369 bytes, patch)
2009-07-17 07:57 UTC, Lucian Langa
rejected Details | Review

Description Lucian Langa 2009-07-17 07:47:40 UTC
After commit dee7dc77 I'm getting a crash in get_host_for_message(), because uri->host is null.
When doing g_hash_table_lookup for priv->host it will crash in hash_function (soup_uri_host_hash).

uri->host can be null in get_host_for_message when we have an url that follows a 301 redirect to "about:blank", I know it's plain stupid but it is possible.
Comment 1 Lucian Langa 2009-07-17 07:57:28 UTC
Created attachment 138573 [details] [review]
check uri->host in soup_uri_host_hash

return NULL in soup_uri_host_hash() as I do not think scheme + port can be valid.
When we have 301 to about:blank scheme = about, port = 0 which is invalid either way.
Comment 2 Dan Winship 2009-07-17 14:11:53 UTC
Ah... about:blank. That's an interesting case.

There are various places that assume that get_host_for_message() never returns NULL, so this change isn't right.

I fixed this bug in the right place (redirect_handler) at one point (bug 528882), but the fix ended up breaking rhythmbox (bug 553466). But we can make a compromise fix by at least requiring redirect URIs to have a host.


*** This bug has been marked as a duplicate of 528882 ***