[Bug 243164] blacklistd not handling masks correctly
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Wed Jan 8 01:58:18 UTC 2020
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=243164
--- Comment #4 from Conrad Meyer <cem at freebsd.org> ---
Helge, does this fix the issue?
--- a/contrib/blacklist/bin/conf.c
+++ b/contrib/blacklist/bin/conf.c
@@ -466,7 +466,6 @@ conf_amask_eq(const void *v1, const void *v2, size_t len,
int mask)
uint32_t m;
int omask = mask;
- len >>= 2;
switch (mask) {
case FSTAR:
if (memcmp(v1, v2, len) == 0)
@@ -481,7 +480,7 @@ conf_amask_eq(const void *v1, const void *v2, size_t len,
int mask)
break;
}
- for (size_t i = 0; i < len; i++) {
+ for (size_t i = 0; i < (len >> 2); i++) {
if (mask > 32) {
m = htonl((uint32_t)~0);
mask -= 32;
@@ -497,7 +496,6 @@ conf_amask_eq(const void *v1, const void *v2, size_t len,
int mask)
out:
if (debug > 1) {
char b1[256], b2[256];
- len <<= 2;
blhexdump(b1, sizeof(b1), "a1", v1, len);
blhexdump(b2, sizeof(b2), "a2", v2, len);
(*lfun)(LOG_DEBUG, "%s: %s != %s [0x%x]", __func__,
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list