aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-image-gif.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-05-23 12:20:15 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-05-23 12:20:15 +0000
commit401dba89870f80f6a7ef4f2a397d7cfeb36c480f (patch)
tree067f2af937b8708cfa3bf95bb02c85c88f03a9af /epan/dissectors/packet-image-gif.c
parent551dcff815a584c2b84e41ab48cda511959a973b (diff)
Fix bug #7277
Check tvb length before fetching data. svn path=/trunk/; revision=42812
Diffstat (limited to 'epan/dissectors/packet-image-gif.c')
-rw-r--r--epan/dissectors/packet-image-gif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/epan/dissectors/packet-image-gif.c b/epan/dissectors/packet-image-gif.c
index 1ada5dafcc..ce648d22d4 100644
--- a/epan/dissectors/packet-image-gif.c
+++ b/epan/dissectors/packet-image-gif.c
@@ -146,12 +146,14 @@ dissect_gif(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
guint8 color_resolution;
guint8 image_bpp;
guint tvb_len = tvb_reported_length(tvb);
- char *str = tvb_get_ephemeral_string(tvb, 0, 6);
+ char *str;
+
guint8 version = 0;
if (tvb_len < 20)
return 0;
+ str = tvb_get_ephemeral_string(tvb, 0, 6);
/* Check whether we're processing a GIF object */
/* see http://www.w3.org/Graphics/GIF/spec-gif89a.txt section 17 */
if (strcmp(str, "GIF87a") == 0) {