HTTP: Fix a glib warning for improper HTTP response

Thu, 07 Nov 2013 01:51:26 +0100

author
Tomasz Wasilczyk <twasilczyk@pidgin.im>
date
Thu, 07 Nov 2013 01:51:26 +0100
changeset 34516
cefaf531281e
parent 34513
6f6de16b4044
child 34517
cf55be38bbbc
child 35054
4fbc76d86745

HTTP: Fix a glib warning for improper HTTP response

libpurple/http.c file | annotate | diff | comparison | revisions
--- a/libpurple/http.c	Tue Nov 05 18:52:38 2013 +0100
+++ b/libpurple/http.c	Thu Nov 07 01:51:26 2013 +0100
@@ -1117,9 +1117,10 @@
 			purple_http_conn_retry(hc);
 			return FALSE;
 		} else {
-			if (g_ascii_strcasecmp(purple_http_headers_get(
-				hc->response->headers, "Server"),
-				"YHttpServer") == 0)
+			const gchar *server = purple_http_headers_get(
+				hc->response->headers, "Server");
+			if (server &&
+				g_ascii_strcasecmp(server, "YHttpServer") == 0)
 			{
 				purple_debug_warning("http", "No more data "
 					"while parsing headers (YHttpServer "

mercurial