Blame SOURCES/wireshark-1.10.14-CVE-2015-3813.patch
|
|
affdba |
diff --git a/epan/reassemble.c b/epan/reassemble.c
|
|
|
affdba |
index 5ff9dcf..0838cb1 100644
|
|
|
affdba |
--- a/epan/reassemble.c
|
|
|
affdba |
+++ b/epan/reassemble.c
|
|
|
affdba |
@@ -1008,9 +1008,11 @@ fragment_add_work(fragment_data *fd_head, tvbuff_t *tvb, const int offset,
|
|
|
affdba |
|
|
|
affdba |
/* If we have reached this point, the packet is not defragmented yet.
|
|
|
affdba |
* Save all payload in a buffer until we can defragment.
|
|
|
affdba |
- * XXX - what if we didn't capture the entire fragment due
|
|
|
affdba |
- * to a too-short snapshot length?
|
|
|
affdba |
*/
|
|
|
affdba |
+ if (!tvb_bytes_exist(tvb, offset, fd->len)) {
|
|
|
affdba |
+ g_slice_free(fragment_data, fd);
|
|
|
affdba |
+ THROW(BoundsError);
|
|
|
affdba |
+ }
|
|
|
affdba |
fd->data = (unsigned char *)g_malloc(fd->len);
|
|
|
affdba |
tvb_memcpy(tvb, fd->data, offset, fd->len);
|
|
|
affdba |
LINK_FRAG(fd_head,fd);
|