From 2c36453937e2772f7f6d4d755aa82563c2c8968b Mon Sep 17 00:00:00 2001 From: "Chloe M." Date: Sat, 22 Aug 2026 09:55:10 +0000 Subject: core: build: Use strtok_r in build.c Signed-off-by: Chloe M. --- core/build.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/build.c b/core/build.c index 8bb7a3c..ab80cad 100644 --- a/core/build.c +++ b/core/build.c @@ -356,6 +356,7 @@ try_mf_make(const char *dirpath, const char *manifest_entry, bool *rehash) { char *p, *tok, *name; + char *save; char pathbuf[256]; char hash[BOP_HASH_LEN]; int error; @@ -375,7 +376,7 @@ try_mf_make(const char *dirpath, const char *manifest_entry, } /* Grab the filename and construct a path */ - tok = strtok(p, ":"); + tok = strtok_r(p, ":", &save); snprintf(pathbuf, sizeof(pathbuf), "%s/%s", dirpath, tok); /* Copy the name */ @@ -385,7 +386,7 @@ try_mf_make(const char *dirpath, const char *manifest_entry, } /* Grab the old hash and create a new hash */ - tok = strtok(NULL, ":"); + tok = strtok_r(NULL, ":", &save); if ((error = bop_hash_file(pathbuf, hash)) < 0) { printf("[!] failed to hash %s\n", pathbuf); free(p); -- cgit v1.2.3