diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-11-05 19:14:30 -0500 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-11-06 08:29:35 -0500 |
| commit | 31997b9109db58180f8b85743a0aec9d80c7305e (patch) | |
| tree | ad3669bcd6465051020eea7bfcdb539f62fc83f7 | |
| parent | c1b199d084058082a9b00d4cef9d274394bfc4cc (diff) | |
| download | stasis-31997b9109db58180f8b85743a0aec9d80c7305e.tar.gz | |
Fix buffer overflow while building command string
| -rw-r--r-- | src/cli/stasis_indexer/stasis_indexer_main.c | 4 |
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); |
