aboutsummaryrefslogtreecommitdiff
path: root/src/lib/delivery/delivery_build.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/delivery/delivery_build.c')
-rw-r--r--src/lib/delivery/delivery_build.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/delivery/delivery_build.c b/src/lib/delivery/delivery_build.c
index 3ff5df7..49d2f5b 100644
--- a/src/lib/delivery/delivery_build.c
+++ b/src/lib/delivery/delivery_build.c
@@ -34,10 +34,11 @@ int delivery_build_recipes(struct Delivery *ctx) {
tag[len] = '\0';
} else {
strncpy(tag, ctx->tests->test[i]->repository_info_tag, sizeof(tag) - 1);
- tag[strlen(ctx->tests->test[i]->repository_info_tag)] = '\0';
+ tag[sizeof(tag) - 1] = '\0';
}
} else {
strncpy(tag, ctx->tests->test[i]->version, sizeof(tag) - 1);
+ tag[sizeof(tag) - 1] = '\0';
}
//sprintf(recipe_version, "{%% set version = GIT_DESCRIBE_TAG ~ \".dev\" ~ GIT_DESCRIBE_NUMBER ~ \"+\" ~ GIT_DESCRIBE_HASH %%}");
@@ -51,6 +52,7 @@ int delivery_build_recipes(struct Delivery *ctx) {
snprintf(recipe_version, sizeof(recipe_version), "{%% set version = \"%s\" %%}", tag);
snprintf(recipe_git_url, sizeof(recipe_git_url), " url: %s/archive/refs/tags/{{ version }}.tar.gz", ctx->tests->test[i]->repository);
strncpy(recipe_git_rev, "", sizeof(recipe_git_rev) - 1);
+ recipe_git_rev[sizeof(recipe_git_rev) - 1] = '\0';
snprintf(recipe_buildno, sizeof(recipe_buildno), " number: 0");
unsigned flags = REPLACE_TRUNCATE_AFTER_MATCH;
@@ -79,14 +81,17 @@ int delivery_build_recipes(struct Delivery *ctx) {
memset(platform, 0, sizeof(platform));
strncpy(platform, "osx", sizeof(platform) - 1);
}
+ platform[sizeof(platform) - 1] = '\0';
tolower_s(platform);
+
if (strstr(ctx->system.arch, "arm64")) {
strncpy(arch, "arm64", sizeof(arch) - 1);
} else if (strstr(ctx->system.arch, "64")) {
strncpy(arch, "64", sizeof(arch) - 1);
} else {
- strncat(arch, "32", sizeof(arch) - 1); // blind guess
+ strncat(arch, "32", sizeof(arch) - strlen(arch) - 1); // blind guess
}
+ arch[sizeof(arch) - 1] = '\0';
tolower_s(arch);
snprintf(command, sizeof(command), "mambabuild --python=%s -m ../.ci_support/%s_%s_.yaml .",
@@ -385,6 +390,7 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) {
char name[100] = {0};
char *fullspec = strlist_item(ctx->conda.pip_packages_defer, p);
strncpy(name, fullspec, sizeof(name) - 1);
+ name[sizeof(name) - 1] = '\0';
remove_extras(name);
char *spec = find_version_spec(name);
if (spec) {
@@ -435,6 +441,7 @@ struct StrList *delivery_build_wheels(struct Delivery *ctx) {
}
strncpy(dname, ctx->tests->test[i]->name, sizeof(dname) - 1);
+ dname[sizeof(dname) - 1] = '\0';
tolower_s(dname);
snprintf(outdir, sizeof(outdir), "%s/%s", ctx->storage.wheel_artifact_dir, dname);
if (mkdirs(outdir, 0755)) {