diff options
author | Gerald Combs <gerald@wireshark.org> | 2003-05-19 03:23:12 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2003-05-19 03:23:12 +0000 |
commit | 7a132e5b48db1f5fea29d461daa8d3a481432918 (patch) | |
tree | 52efc6af782789bdc73143e570d7f654e6799987 /packet-quake3.c | |
parent | a53a260f3c9f6a3bc0ac3ab4ec824f4b39a82ef0 (diff) |
More tvb_get_nstringz0() fixes. Timo Sirainen pointed out that Bad
Things can happen if we pass a zero buffer length to tvb_get_nstringz0().
Throw an exception if this happens.
In various dissectors make sure the tvb_get_nstringz0()'s buffer length
is greater than zero.
svn path=/trunk/; revision=7688
Diffstat (limited to 'packet-quake3.c')
-rw-r--r-- | packet-quake3.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/packet-quake3.c b/packet-quake3.c index eb0c4a5b51..1255e581c5 100644 --- a/packet-quake3.c +++ b/packet-quake3.c @@ -3,7 +3,7 @@ * * Uwe Girlich <uwe@planetquake.com> * - * $Id: packet-quake3.c,v 1.14 2002/08/28 21:00:27 jmayer Exp $ + * $Id: packet-quake3.c,v 1.15 2003/05/19 03:23:11 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -174,8 +174,7 @@ dissect_quake3_ConnectionlessPacket(tvbuff_t *tvb, packet_info *pinfo _U_, /* all the rest of the packet is just text */ offset = 4; - maxbufsize = MIN((gint)sizeof(text), tvb_length_remaining(tvb, offset)); - len = tvb_get_nstringz0(tvb, offset, maxbufsize, text); + len = tvb_get_nstringz0(tvb, offset, sizeof(text), text); if (cl_tree) { text_item = proto_tree_add_string(cl_tree, hf_quake3_connectionless_text, |