mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 04:36:21 +00:00
fortify: use reentrant safe strtok_r
Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
e6a19d2683
commit
2796cf790f
@ -750,7 +750,7 @@ static int setup_tty(const struct lxc_rootfs *rootfs,
|
|||||||
static int setup_rootfs_pivot_root_cb(char *buffer, void *data)
|
static int setup_rootfs_pivot_root_cb(char *buffer, void *data)
|
||||||
{
|
{
|
||||||
struct lxc_list *mountlist, *listentry, *iterator;
|
struct lxc_list *mountlist, *listentry, *iterator;
|
||||||
char *pivotdir, *mountpoint, *mountentry;
|
char *pivotdir, *mountpoint, *mountentry, *saveptr;
|
||||||
int found;
|
int found;
|
||||||
void **cbparm;
|
void **cbparm;
|
||||||
|
|
||||||
@ -761,12 +761,12 @@ static int setup_rootfs_pivot_root_cb(char *buffer, void *data)
|
|||||||
pivotdir = cbparm[1];
|
pivotdir = cbparm[1];
|
||||||
|
|
||||||
/* parse entry, first field is mountname, ignore */
|
/* parse entry, first field is mountname, ignore */
|
||||||
mountpoint = strtok(mountentry, " ");
|
mountpoint = strtok_r(mountentry, " ", &saveptr);
|
||||||
if (!mountpoint)
|
if (!mountpoint)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* second field is mountpoint */
|
/* second field is mountpoint */
|
||||||
mountpoint = strtok(NULL, " ");
|
mountpoint = strtok_r(NULL, " ", &saveptr);
|
||||||
if (!mountpoint)
|
if (!mountpoint)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user