From 0181043045ffbd6d77424c3798c6504515422d30 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 14 Oct 2012 22:55:51 +0000 Subject: Copy over revisions from trunk: ------------------------------------------------------------------------ r45548 | guy | 2012-10-14 15:53:25 -0700 (Sun, 14 Oct 2012) | 2 lines Clean up the "round up to a multiple of 4" code a bit. ------------------------------------------------------------------------ r45524 | eapache | 2012-10-13 15:12:52 -0700 (Sat, 13 Oct 2012) | 9 lines Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7858 Use a full 32-bit literal instead of just a 16-bit one. Fixes case where the value we're &-ing with just slips over 2^16, making us get stuck in an infinite loop. I'm not sure this matches the iscsi spec anymore, the comment in the code about padding bytes is ambiguous as to whether they're leading or trailing. svn path=/trunk-1.8/; revision=45549 --- epan/dissectors/packet-iscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index c2255506fe..f00d8def48 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -1003,8 +1003,8 @@ dissect_iscsi_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off } /* strip off padding bytes */ - if(ahs_offset&0x0003){ - ahs_offset=(ahs_offset+3)&0xfffc; + if(ahs_offset & 3){ + ahs_offset=(ahs_offset+3) & ~3; } } -- cgit v1.2.1