[IP] AddrCountPrefixBits(): Fix loop condition (#4556)

Properly handle BitTest reaching 0.

CORE-18225
This commit is contained in:
Serge Gautherie 2022-06-25 17:14:03 +02:00 committed by GitHub
parent d4a398fb13
commit ef1311b7a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,7 +71,7 @@ UINT AddrCountPrefixBits( PIP_ADDRESS Netmask ) {
ULONG TestMask = IPv4NToHl(Netmask->Address.IPv4Address);
while( (BitTest & TestMask) == BitTest ) {
while ((BitTest & TestMask) != 0) {
Prefix++;
BitTest >>= 1;
}