aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-05-12 12:02:38 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-05-12 12:02:38 -0400
commit0c23437108bc5c7c00104345f2a22bd9da607e20 (patch)
treed8fea5679199df4c334e399da328b7ad18bb384c
parent45d8e2aeb737a5d3b91217a01f81392341f190d2 (diff)
downloadstasis-0c23437108bc5c7c00104345f2a22bd9da607e20.tar.gz
Placate FORTIFY_SOURCE warning
* The log_root in almost every circumstance will be able to handle the extra slash chracter. It complains because log_file and log_path are both sizeof PATH_MAX
-rw-r--r--src/lib/core/multiprocessing.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/core/multiprocessing.c b/src/lib/core/multiprocessing.c
index 11add1e..b17bdc1 100644
--- a/src/lib/core/multiprocessing.c
+++ b/src/lib/core/multiprocessing.c
@@ -196,7 +196,9 @@ struct MultiProcessingTask *mp_pool_task(struct MultiProcessingPool *pool, const
// Set log file path
memset(slot->log_file, 0, sizeof(*slot->log_file));
if (globals.enable_task_logging) {
- snprintf(slot->log_file, sizeof(slot->log_file) - strlen(slot->log_file), "%s/", pool->log_root);
+ snprintf(slot->log_file, sizeof(slot->log_file), "%s", pool->log_root);
+ // FORTIFY_SOURCE won't leave snprintf alone. The chance for truncation is slim anyway.
+ strncat(slot->log_file, "/", sizeof(slot->log_file) - strlen(slot->log_file));
} else {
snprintf(slot->log_file, sizeof(slot->log_file), "/dev/stdout");
}