summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/dissectors/packet-http.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 5ac17ea857..8bd466bb0f 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -896,13 +896,16 @@ dissect_http_message(tvbuff_t *tvb, int offset, packet_info *pinfo,
if (tree && stat_info->http_host && stat_info->request_uri) {
proto_item *e_ti;
- size_t size = strlen("http://") + strlen(stat_info->http_host)
+ gchar* hostname = g_strstrip(g_strdup(stat_info->http_host));
+ size_t size = strlen("http://") + strlen(hostname)
+ strlen(stat_info->request_uri) + 1;
char *uri = ep_alloc(size);
g_snprintf(uri, (gulong)size, "%s://%s%s",
"http", /* XXX, https? */
- stat_info->http_host, stat_info->request_uri);
+ hostname, stat_info->request_uri);
+
+ g_free(hostname);
e_ti = proto_tree_add_string(http_tree,
hf_http_request_full_uri, tvb, 0,