diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-10-04 10:23:40 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-10-04 10:23:40 +0000 |
commit | 2a8e47b11a19e61a9df3e7322e54cd0c00dbd25b (patch) | |
tree | 9cd7888f1053b91641991667ae98a5dbe813787d /epan/dissectors/packet-windows-common.h | |
parent | 72dd04b43c973bb1f22bedf682909237efed2c1c (diff) |
Don't ensure all the bytes of a security descriptor exist before calling
"dissect_nt_sec_desc()". Add a Boolean argument to
"dissect_nt_sec_desc()" to indicate whether a length was passed to it
(so we don't treat -1 as a special value; we want to stop treating -1 as
a special length value, and, in fact, want to stop treating *any*
negative length values specially, so that we don't have to worry about
passing arbitrary 32-bit values from packets as lengths), and have
"dissect_nt_sec_desc()" initially create the protocol tree item for the
security descriptor with a length of "go to the end of the tvbuff", and
set the length once we're done dissecting it - and, if the length was
specified, check at *that* point, *after* we've dissected the security
descriptor, whether we have the entire security descriptor in the
tvbuff.
That means that we don't have to worry about overflows after
"dissect_nt_sec_desc()" returns - if the length was so large that we
would have gotten an overflow, we'd have thrown an exception in the
"tvb_ensure_bytes_exist()" call at the end of "dissect_nt_sec_desc()".
Do sanity checks on offsets within the security descriptor, so we know
the item referred to by the offset is after the fixed-length portion of
the descriptor.
svn path=/trunk/; revision=16113
Diffstat (limited to 'epan/dissectors/packet-windows-common.h')
-rw-r--r-- | epan/dissectors/packet-windows-common.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-windows-common.h b/epan/dissectors/packet-windows-common.h index 8591614c25..ef9da37bbf 100644 --- a/epan/dissectors/packet-windows-common.h +++ b/epan/dissectors/packet-windows-common.h @@ -173,7 +173,8 @@ dissect_nt_access_mask(tvbuff_t *tvb, gint offset, packet_info *pinfo, int dissect_nt_sec_desc(tvbuff_t *tvb, int offset, packet_info *pinfo, - proto_tree *parent_tree, guint8 *drep, int len, + proto_tree *parent_tree, guint8 *drep, + gboolean len_supplied, int len, struct access_mask_info *ami); void |