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-aim.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-aim.c')
-rw-r--r-- | packet-aim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-aim.c b/packet-aim.c index b2a65df1e4..bf059f5a2d 100644 --- a/packet-aim.c +++ b/packet-aim.c @@ -2,7 +2,7 @@ * Routines for AIM Instant Messenger (OSCAR) dissection * Copyright 2000, Ralf Hoelzer <ralf@well.com> * - * $Id: packet-aim.c,v 1.28 2003/05/11 02:40:36 guy Exp $ + * $Id: packet-aim.c,v 1.29 2003/05/19 03:23:10 gerald Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1742,8 +1742,8 @@ static int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_, /* Show the info in the top of the tree if it's one of the standard data types */ - if (tmp[i].datatype == FT_STRING) { - guint8 *buf; + if (tmp[i].datatype == FT_STRING && length > 0) { + guint8 *buf; buf = g_malloc(length); tvb_get_nstringz0(tvb, offset + 4, length, buf); ti1 = proto_tree_add_text(tree, tvb, offset, length + 4, |