diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/stasis_indexer.c | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/src/stasis_indexer.c b/src/stasis_indexer.c index 8ee575e..b38c8d0 100644 --- a/src/stasis_indexer.c +++ b/src/stasis_indexer.c @@ -72,9 +72,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;          } -        sprintf(cmd + strlen(cmd), "'%s'/ ", srcdir); +        snprintf(cmd + strlen(cmd), sizeof(srcdir) - strlen(srcdir) + 4, "'%s'/ ", srcdir);      } -    sprintf(cmd + strlen(cmd), "%s/", destdir); +    snprintf(cmd + strlen(cmd), sizeof(cmd) - strlen(destdir) + 1, " %s/", destdir);      if (globals.verbose) {          puts(cmd); @@ -368,6 +368,8 @@ int indexer_make_website(struct Delivery *ctx) {              // This might be negative when killed by a signal.              // Otherwise, the return code is not critical to us.              if (system(cmd) < 0) { +                guard_free(css_filename); +                guard_strlist_free(&dirs);                  return 1;              }              if (file_replace_text(fullpath_dest, ".md", ".html", 0)) { @@ -388,6 +390,7 @@ int indexer_make_website(struct Delivery *ctx) {          }          guard_strlist_free(&inputs);      } +    guard_free(css_filename);      guard_strlist_free(&dirs);      return 0; | 
