On Wed, May 12, 2021 at 10:32 AM Ondrej Mosnacek <[email protected]> wrote: > > While trying to address a Coverity warning that the dev_name string > might end up unterminated when strcpy'ing it in > selinux_ib_endport_manage_subnet(), I realized that it is possible (and > simpler) to just pass the dev_name pointer directly, rather than copying > the string to a buffer. > > The ibendport variable goes out of scope at the end of the function > anyway, so the lifetime of the dev_name pointer will never be shorter > than that of ibendport, thus we can safely just pass the dev_name > pointer and be done with it. > > Signed-off-by: Ondrej Mosnacek <[email protected]> > --- > include/linux/lsm_audit.h | 8 ++++---- > security/selinux/hooks.c | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-)
Much better, merged into selinux/next. Thanks. -- paul moore www.paul-moore.com -- Linux-audit mailing list [email protected] https://listman.redhat.com/mailman/listinfo/linux-audit
