diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-05-27 18:08:46 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2011-05-27 18:08:46 +0000 |
commit | 0a3319cbc61bf04f55ccd0ed2f6e5c9511909d19 (patch) | |
tree | a350046cc9bd13f41122d7c3542abc1b4f62ed71 /epan/dissectors/packet-x11.c | |
parent | e3dff872d0ed6acf5b602abba8d21f1adf8ba076 (diff) |
Use a non-volatile temporary variable as a parameter to DISSECTOR_ASSERT().
This avoids an "assert with side effects" warning and resolves Coverity CID322.
svn path=/trunk/; revision=37441
Diffstat (limited to 'epan/dissectors/packet-x11.c')
-rw-r--r-- | epan/dissectors/packet-x11.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/epan/dissectors/packet-x11.c b/epan/dissectors/packet-x11.c index 096bccf83c..39d5fea98b 100644 --- a/epan/dissectors/packet-x11.c +++ b/epan/dissectors/packet-x11.c @@ -4757,12 +4757,18 @@ dissect_x11_replies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) break; case 1: + { + /* To avoid an "assert w/side-effect" warning, + * use a non-volatile temp variable instead. */ + int tmp_plen; + /* replylength is in units of four. */ - plen = 32 + VALUE32(tvb, offset + 4) * 4; - DISSECTOR_ASSERT(plen >= 32); + tmp_plen = plen = 32 + VALUE32(tvb, offset + 4) * 4; + DISSECTOR_ASSERT(tmp_plen >= 32); HANDLE_REPLY(plen, length_remaining, "Reply", dissect_x11_reply); break; + } default: /* Event */ |