forked from osmocom/wireshark
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
This commit is contained in:
parent
e3dff872d0
commit
0a3319cbc6
1 changed files with 8 additions and 2 deletions
|
@ -4757,12 +4757,18 @@ dissect_x11_replies(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
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. */
|
/* replylength is in units of four. */
|
||||||
plen = 32 + VALUE32(tvb, offset + 4) * 4;
|
tmp_plen = plen = 32 + VALUE32(tvb, offset + 4) * 4;
|
||||||
DISSECTOR_ASSERT(plen >= 32);
|
DISSECTOR_ASSERT(tmp_plen >= 32);
|
||||||
HANDLE_REPLY(plen, length_remaining,
|
HANDLE_REPLY(plen, length_remaining,
|
||||||
"Reply", dissect_x11_reply);
|
"Reply", dissect_x11_reply);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Event */
|
/* Event */
|
||||||
|
|
Loading…
Reference in a new issue