[PATCH] iphlpapi: Fix ULONG comparisons, most notably for IPv4 addresses.

Francois Gouget fgouget at codeweavers.com
Tue Feb 15 06:46:14 CST 2022


On Tue, 15 Feb 2022, Huw Davies wrote:

> On Tue, Feb 15, 2022 at 03:35:37AM +0100, Francois Gouget wrote:
> > The difference between two ULONGs may not fit in an int, causing sorting
> > errors.
> > 
> > Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
> > ---
> > Another approach would be to modify all the comparison functions to
> > return a 64-bit value which would ensure no overflow happensi (they are
> > all internal functions so that should work).
> > 
> > The IPv6 address comparisons use memcmp() so the resulting value should
> > fit in an int.
> 
> How about introducing a DWORD_cmp() helper?

That works. I'll resubmit.

-- 
Francois Gouget <fgouget at codeweavers.com>



More information about the wine-devel mailing list