]> git.proxmox.com Git - mirror_lxc.git/commitdiff
fortify: use reentrant safe strtok_r
authorDwight Engen <dwight.engen@oracle.com>
Mon, 15 Apr 2013 19:28:07 +0000 (15:28 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 16 Apr 2013 10:16:41 +0000 (12:16 +0200)
Signed-off-by: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c

index c416da5fa4c0f54941f9d33c04cd627705905866..917c0526b20e5ad60b337a2d102d29ab06615a62 100644 (file)
@@ -750,7 +750,7 @@ static int setup_tty(const struct lxc_rootfs *rootfs,
 static int setup_rootfs_pivot_root_cb(char *buffer, void *data)
 {
        struct lxc_list *mountlist, *listentry, *iterator;
-       char *pivotdir, *mountpoint, *mountentry;
+       char *pivotdir, *mountpoint, *mountentry, *saveptr;
        int found;
        void **cbparm;
 
@@ -761,12 +761,12 @@ static int setup_rootfs_pivot_root_cb(char *buffer, void *data)
        pivotdir  = cbparm[1];
 
        /* parse entry, first field is mountname, ignore */
-       mountpoint = strtok(mountentry, " ");
+       mountpoint = strtok_r(mountentry, " ", &saveptr);
        if (!mountpoint)
                return -1;
 
        /* second field is mountpoint */
-       mountpoint = strtok(NULL, " ");
+       mountpoint = strtok_r(NULL, " ", &saveptr);
        if (!mountpoint)
                return -1;