aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2025-11-05 19:14:30 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2025-11-06 08:29:35 -0500
commit31997b9109db58180f8b85743a0aec9d80c7305e (patch)
treead3669bcd6465051020eea7bfcdb539f62fc83f7
parentc1b199d084058082a9b00d4cef9d274394bfc4cc (diff)
downloadstasis-31997b9109db58180f8b85743a0aec9d80c7305e.tar.gz
Fix buffer overflow while building command string
-rw-r--r--src/cli/stasis_indexer/stasis_indexer_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cli/stasis_indexer/stasis_indexer_main.c b/src/cli/stasis_indexer/stasis_indexer_main.c
index c984718..840e897 100644
--- a/src/cli/stasis_indexer/stasis_indexer_main.c
+++ b/src/cli/stasis_indexer/stasis_indexer_main.c
@@ -38,9 +38,9 @@ int indexer_combine_rootdirs(const char *dest, char **rootdirs, const size_t roo
if (!access(srcdir_with_output, F_OK)) {
srcdir = srcdir_with_output;
}
- snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(srcdir) + 4, "'%s'/ ", srcdir);
+ snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(cmd), "'%s'/ ", srcdir);
}
- snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(destdir) + 2, " %s/", destdir);
+ snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(cmd), " %s/", destdir);
if (globals.verbose) {
puts(cmd);