Use a 64-bit number to store the content length. This fixes:

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1958

Of course this doesn't mean we can reassemble that much data.

svn path=/trunk/; revision=32433
This commit is contained in:
Jeff Morriss 2010-04-09 01:42:12 +00:00
parent ecf1a60a12
commit 873a93c7b1
2 changed files with 12 additions and 3 deletions

View File

@ -1682,6 +1682,7 @@ AC_SUBST(STRPTIME_O)
AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
AC_CHECK_FUNCS(issetugid)
AC_CHECK_FUNCS(mmap mprotect sysconf)
AC_CHECK_FUNCS(strtoll)
dnl blank for now, but will be used in future
AC_SUBST(wireshark_SUBDIRS)

View File

@ -239,7 +239,7 @@ typedef struct {
char *content_type;
char *content_type_parameters;
gboolean have_content_length;
long content_length; /* XXX - make it 64-bit? */
gint64 content_length;
char *content_encoding;
char *transfer_encoding;
} headers_t;
@ -2053,7 +2053,15 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
break;
case HDR_CONTENT_LENGTH:
#if GLIB_CHECK_VERSION(2,12,0)
eh_ptr->content_length = g_ascii_strtoll(value, &p, 10);
#elif defined(HAVE_STRTOLL)
eh_ptr->content_length = strtoll(value, &p, 10);
#else
/* Punt and grab a 32-bit value */
eh_ptr->content_length = strtol(value, &p, 10);
#endif
up = (guchar *)p;
if (eh_ptr->content_length < 0 || p == value ||
(*up != '\0' && !isspace(*up))) {
@ -2070,7 +2078,7 @@ process_header(tvbuff_t *tvb, int offset, int next_offset,
*/
eh_ptr->have_content_length = TRUE;
header_tree = proto_item_add_subtree(hdr_item, ett_http_header_item);
tree_item = proto_tree_add_uint(header_tree, hf_http_content_length,
tree_item = proto_tree_add_uint64(header_tree, hf_http_content_length,
tvb, offset, len, eh_ptr->content_length);
PROTO_ITEM_SET_GENERATED(tree_item);
}
@ -2330,7 +2338,7 @@ proto_register_http(void)
"HTTP Content-Length header", HFILL }},
{ &hf_http_content_length,
{ "Content length", "http.content_length",
FT_UINT32, BASE_DEC, NULL, 0x0,
FT_UINT64, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
{ &hf_http_content_encoding,
{ "Content-Encoding", "http.content_encoding",