abdd45
diff -up pidgin-2.10.7/libpurple/protocols/gg/lib/http.c.CVE-2013-6487 pidgin-2.10.7/libpurple/protocols/gg/lib/http.c
abdd45
--- pidgin-2.10.7/libpurple/protocols/gg/lib/http.c.CVE-2013-6487	2013-02-11 04:16:52.000000000 -0500
abdd45
+++ pidgin-2.10.7/libpurple/protocols/gg/lib/http.c	2014-01-29 20:52:59.629513642 -0500
abdd45
@@ -47,6 +47,8 @@
abdd45
 #include <string.h>
abdd45
 #include <unistd.h>
abdd45
 
abdd45
+#define GG_HTTP_MAX_LENGTH 1000000000
abdd45
+
abdd45
 /**
abdd45
  * Rozpoczyna połączenie HTTP.
abdd45
  *
abdd45
@@ -364,6 +366,11 @@ int gg_http_watch_fd(struct gg_http *h)
abdd45
 				h->body_size = left;
abdd45
 			}
abdd45
 
abdd45
+			if (h->body_size > GG_HTTP_MAX_LENGTH) {
abdd45
+				gg_debug(GG_DEBUG_MISC, "=> http, content-length too big\n");
abdd45
+				h->body_size = GG_HTTP_MAX_LENGTH;
abdd45
+			}
abdd45
+
abdd45
 			if (left > h->body_size) {
abdd45
 				gg_debug(GG_DEBUG_MISC, "=> http, oversized reply (%d bytes needed, %d bytes left)\n", h->body_size, left);
abdd45
 				h->body_size = left;