https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ef1311b7a4cd65756356e…
commit ef1311b7a4cd65756356ea49c199234f1cb7148b
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Sat Jun 25 17:14:03 2022 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Jun 25 17:14:03 2022 +0200
[IP] AddrCountPrefixBits(): Fix loop condition (#4556)
Properly handle BitTest reaching 0.
CORE-18225
---
sdk/lib/drivers/ip/network/address.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/lib/drivers/ip/network/address.c b/sdk/lib/drivers/ip/network/address.c
index 6ddbfd97e6d..27906f62e98 100644
--- a/sdk/lib/drivers/ip/network/address.c
+++ b/sdk/lib/drivers/ip/network/address.c
@@ -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;
}