Wireshark mailing list archives

Re: Fix signed overflow


From: Kevin Cox <kevincox () kevincox ca>
Date: Thu, 11 Feb 2016 10:41:13 -0500

On Wed, 2016-02-10 at 10:46 -0500, Michael McConville wrote:
Signed overflow is undefined, so the overflow check below is
technically
meaningless. Because we're only checking whether an increment will
overflow, we can compare j to G_MAXINT instead.

This is an important fix. The compiler is allowed to (and often will)
just omit that checking code and replace with with a false because it
can never evaluate to true using only defined behaviour. That check is
effectively useless as currently written.

Attachment: signature.asc
Description: This is a digitally signed message part

Attachment: smime.p7s
Description:

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: