Wireshark mailing list archives
Re: Fix signed overflow
From: Michael Mann <mmann78 () netscape net>
Date: Thu, 11 Feb 2016 10:33:13 -0500
Your patch has already been included: https://code.wireshark.org/review/13896 -----Original Message----- From: Michael McConville <mmcco () mykolab com> To: wireshark-dev <wireshark-dev () wireshark org> Sent: Thu, Feb 11, 2016 10:24 am Subject: [Wireshark-dev] Fix signed overflow 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. Thanks for your time, Michael diff --git a/wiretap/merge.c b/wiretap/merge.c index 19c11cd..06dc5db 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -148,7 +148,7 @@ merge_open_in_files(int in_file_count, const char *const *in_file_names, } size = wtap_file_size(files[i].wth, err); if (size == -1) { - for (j = 0; j + 1 > j && j <= i; j++) + for (j = 0; j != G_MAXINT && j <= i; j++) cleanup_in_file(&files[j]); *err_fileno = i; return FALSE; ___________________________________________________________________________ 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
___________________________________________________________________________ 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:
- Fix signed overflow Michael McConville (Feb 11)
- Re: Fix signed overflow Michael Mann (Feb 11)
- Re: Fix signed overflow Guy Harris (Feb 11)
- Re: Fix signed overflow Kevin Cox (Feb 11)
- Re: Fix signed overflow Michael Mann (Feb 11)