diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-11-05 19:14:30 -0500 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2025-11-11 15:54:21 -0500 |
| commit | ef426879fb44e98e6e90d274e336698f2016bddb (patch) | |
| tree | ef5e499aa37cd41597c53e8ff0334c01f49a6c1f /src/cli | |
| parent | dccb3f17cc50545beff4df9c87c7974e1e2412b7 (diff) | |
| download | stasis-ef426879fb44e98e6e90d274e336698f2016bddb.tar.gz | |
Fix buffer overflow while building command string
Diffstat (limited to 'src/cli')
| -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); |
