apparmor: fix use of strcpy in policy_unpack_test
authorRae Moar <rmoar@google.com>
Fri, 27 Jan 2023 20:12:19 +0000 (20:12 +0000)
committerJohn Johansen <john.johansen@canonical.com>
Thu, 6 Jul 2023 17:58:49 +0000 (10:58 -0700)
commitb54aebd4411134b525a82d663a26b2f135ecb7e8
tree94a642e5dd9e758838cb58d5e9908878ccedf705
parent76862af5d1add618f0cc99868bc729925f9551d2
apparmor: fix use of strcpy in policy_unpack_test

Replace the use of strcpy() in build_aa_ext_struct() in
policy_unpack_test.c with strscpy().

strscpy() is the safer method to use to ensure the buffer does not
overflow. This was found by kernel test robot:
https://lore.kernel.org/all/202301040348.NbfVsXO0-lkp@intel.com/.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Rae Moar <rmoar@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/policy_unpack_test.c