aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http.c
diff options
context:
space:
mode:
authorStephen Fisher <steve@stephen-fisher.com>2007-03-16 00:47:26 +0000
committerStephen Fisher <steve@stephen-fisher.com>2007-03-16 00:47:26 +0000
commit4eeb29a8a7224cd42ac38fbba18a44cf58da8fe2 (patch)
tree4946f993cd6e7bb8cc184250cebe6d19193ca6b2 /epan/dissectors/packet-http.c
parenta00dc2564e68645b3041d4e5ae3be1c1fa582211 (diff)
Fix bug #1394: Runtime error crash after clicking on HTTP packet
The capture file the user supplied had a HTTP chunked response in it with no actual chunks other than the zero length chunk indicating the end of the chunks. The fix is to only create a new_tvb and copy it over the tvb going into the chunked_encoding_dissector() function if the chunk size is > 0. svn path=/trunk/; revision=21034
Diffstat (limited to 'epan/dissectors/packet-http.c')
-rw-r--r--epan/dissectors/packet-http.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 9d7e4b5346..bc10bc2990 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -1379,9 +1379,13 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
tvb_memcpy(tvb, (guint8 *)(raw_data + raw_len),
chunk_offset, chunk_size);
- new_tvb = tvb_new_real_data(raw_data,
- chunked_data_size, chunked_data_size);
- tvb_set_free_cb(new_tvb, g_free);
+ /* Don't create a new tvb if we have a single chunk with
+ * a size of zero (meaning it is the end of the chunks). */
+ if(chunked_data_size > 0) {
+ new_tvb = tvb_new_real_data(raw_data,
+ chunked_data_size, chunked_data_size);
+ tvb_set_free_cb(new_tvb, g_free);
+ }
if (subtree) {