Commit 509f8cb2 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by John Johansen
Browse files

apparmor: Fix checking address of an array in accum_label_info()



clang warns:

  security/apparmor/label.c:206:15: error: address of array 'new->vec' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
    206 |         AA_BUG(!new->vec);
        |                ~~~~~~^~~

The address of this array can never be NULL because it is not at the
beginning of a structure. Convert the assertion to check that the new
pointer is not NULL.

Fixes: de4754c8 ("apparmor: carry mediation check on label")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501191802.bDp2voTJ-lkp@intel.com/


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent e6b08767
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment