Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Jan 2020 01:58:18 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 243164] blacklistd not handling masks correctly
Message-ID:  <bug-243164-227-vv68pBcLgt@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-243164-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-243164-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D243164

--- Comment #4 from Conrad Meyer <cem@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 le=
n,
int mask)
        uint32_t m;
        int omask =3D mask;

-       len >>=3D 2;
        switch (mask) {
        case FSTAR:
                if (memcmp(v1, v2, len) =3D=3D 0)
@@ -481,7 +480,7 @@ conf_amask_eq(const void *v1, const void *v2, size_t le=
n,
int mask)
                break;
        }

-       for (size_t i =3D 0; i < len; i++) {
+       for (size_t i =3D 0; i < (len >> 2); i++) {
                if (mask > 32) {
                        m =3D htonl((uint32_t)~0);
                        mask -=3D 32;
@@ -497,7 +496,6 @@ conf_amask_eq(const void *v1, const void *v2, size_t le=
n,
int mask)
 out:
        if (debug > 1) {
                char b1[256], b2[256];
-               len <<=3D 2;
                blhexdump(b1, sizeof(b1), "a1", v1, len);
                blhexdump(b2, sizeof(b2), "a2", v2, len);
                (*lfun)(LOG_DEBUG, "%s: %s !=3D %s [0x%x]", __func__,

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-243164-227-vv68pBcLgt>