From: Dwight Engen Date: Mon, 15 Apr 2013 19:28:07 +0000 (-0400) Subject: fortify: use reentrant safe strtok_r X-Git-Tag: lxc-1.0.0.alpha1~1^2~295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2796cf790f80e8be8dd90238f6789e52bd3cc2ac;p=thirdparty%2Flxc.git fortify: use reentrant safe strtok_r Signed-off-by: Dwight Engen Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index c416da5fa..917c0526b 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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;