From: Christian Brauner Date: Mon, 30 Aug 2021 16:05:29 +0000 (+0200) Subject: lxccontainer: don't pass NULL pointer X-Git-Tag: lxc-5.0.0~97^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3957%2Fhead;p=thirdparty%2Flxc.git lxccontainer: don't pass NULL pointer Signed-off-by: Christian Brauner --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 0218543b5..3b18d00ff 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -3401,12 +3401,12 @@ static int copyhooks(struct lxc_container *oldc, struct lxc_container *c) char *fname, *new_hook; char tmppath[PATH_MAX]; - fname = strrchr(hookname, '/'); + fname = strrchr(entry->val, '/'); if (!fname) return 0; /* If this hook is public - ignore. */ - if (!strnequal(hookname, cpath, len - 1)) + if (!strnequal(entry->val, cpath, len - 1)) continue; /* copy the script, and change the entry in confile */