]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxccontainer: don't pass NULL pointer 3957/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 30 Aug 2021 16:05:29 +0000 (18:05 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 30 Aug 2021 16:05:29 +0000 (18:05 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 0218543b56f50c2db74505e06612a9326850ebfa..3b18d00ff94038fc96f26286d9bdad1631dfe734 100644 (file)
@@ -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 */