aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-x11.c
diff options
context:
space:
mode:
authorcmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-27 18:08:46 +0000
committercmaynard <cmaynard@f5534014-38df-0310-8fa8-9805f1628bb7>2011-05-27 18:08:46 +0000
commit3ed6e80a1f3459e4809555523c3dc011a75384fa (patch)
treea350046cc9bd13f41122d7c3542abc1b4f62ed71 /epan/dissectors/packet-x11.c
parentc29c08e62cba8a7f1d62a2d8d5f8c8064addf175 (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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37441 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-x11.c')
-rw-r--r--epan/dissectors/packet-x11.c10
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 */