/cpw/tomkiewicz/http: abec627c3a47: Segfault found, temporarily ...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Sun Oct 14 02:28:12 EDT 2012


Changeset: abec627c3a4739c7d0141141af49b821bf96a0f7
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-10-14 08:28 +0200
Branch:	 default
URL: http://hg.pidgin.im/cpw/tomkiewicz/http/rev/abec627c3a47

Description:

Segfault found, temporarily fixed

diffstat:

 libpurple/http.c            |  7 ++++---
 libpurple/protocols/gg/gg.c |  6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (43 lines):

diff --git a/libpurple/http.c b/libpurple/http.c
--- a/libpurple/http.c
+++ b/libpurple/http.c
@@ -129,8 +129,9 @@ static PurpleHttpHeaders * purple_http_h
 {
 	PurpleHttpHeaders *hdrs = g_new0(PurpleHttpHeaders, 1);
 
-	hdrs->by_name = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
-		(GDestroyNotify)g_list_free);
+	hdrs->by_name = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
+//	hdrs->by_name = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
+//		(GDestroyNotify)g_list_free);
 
 	return hdrs;
 }
@@ -406,8 +407,8 @@ static gboolean _purple_http_recv_body_c
 		return FALSE;
 	if (!hc->response_buffer)
 		hc->response_buffer = g_string_new("");
+
 	g_string_append_len(hc->response_buffer, buf, len); //TODO: check max buffer length, not to raise to infinity
-
 	while (hc->response_buffer->len > 0) {
 		if (hc->in_chunk) {
 			int got_now = hc->response_buffer->len;
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -72,11 +72,11 @@ static void ggp_test_http_cb(PurpleHttpC
 		purple_http_response_get_error(response));
 
 	data = purple_http_response_get_data(response);
-	if (strlen(data) < 50)
+	if (strlen(data) < 200)
 		purple_debug_info("http-test", "Returned content: [%s].\n", data);
 	else {
-		data_front = g_strndup(data, 20);
-		data_tail = g_strdup(data + strlen(data) - 20);
+		data_front = g_strndup(data, 100);
+		data_tail = g_strdup(data + strlen(data) - 100);
 		purple_debug_info("http-test", "Returned content: [%s ... %s].\n",
 			data_front, data_tail);
 		g_free(data_front);



More information about the Commits mailing list