summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/libgadu/http.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2018-01-18 17:57:36 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2018-01-19 01:39:33 +0100
commitfb40ed2b6385b9e3a85b35ba27f3a42207d22234 (patch)
tree9de6415c9c28c68d2fe750abe2c95c3a89ba08ca /protocols/Gadu-Gadu/src/libgadu/http.cpp
parent97bb7e79c15952e7f9bf47caef4e3c09dd63c8df (diff)
Gadu-Gadu: update libgadu to 1.11.4
Diffstat (limited to 'protocols/Gadu-Gadu/src/libgadu/http.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/libgadu/http.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/protocols/Gadu-Gadu/src/libgadu/http.cpp b/protocols/Gadu-Gadu/src/libgadu/http.cpp
index 5b8549dc3b..b6e4b8a7fc 100644
--- a/protocols/Gadu-Gadu/src/libgadu/http.cpp
+++ b/protocols/Gadu-Gadu/src/libgadu/http.cpp
@@ -1,4 +1,4 @@
-/* $Id: http.c 11370 2010-03-13 16:17:54Z dezred $ */
+/* $Id$ */
/*
* (C) Copyright 2001-2002 Wojtek Kaniewski <wojtekka@irc.pl>
@@ -51,6 +51,8 @@
#include <unistd.h>
#endif /* _WIN32 */
+#define GG_HTTP_MAX_LENGTH 1000000000
+
/**
* Rozpoczyna połączenie HTTP.
*
@@ -368,6 +370,11 @@ int gg_http_watch_fd(struct gg_http *h)
h->body_size = left;
}
+ if (h->body_size > GG_HTTP_MAX_LENGTH) {
+ gg_debug(GG_DEBUG_MISC, "=> http, content-length too big\n");
+ h->body_size = GG_HTTP_MAX_LENGTH;
+ }
+
if (left > h->body_size) {
gg_debug(GG_DEBUG_MISC, "=> http, oversized reply (%d bytes needed, %d bytes left)\n", h->body_size, left);
h->body_size = left;