Skip to content

Commit

Permalink
Freshclam: fix crash when using DatabaseCustomURL for CVD and other f…
Browse files Browse the repository at this point in the history
…iles

Freshclam may crash if using DatabaseCustomURL for a CVD and multiple
other files. The issue occurs because of a bad index in the "do not
prune" list.

Fixes: Cisco-Talos#1364
  • Loading branch information
micahsnyder committed Oct 30, 2024
1 parent 52b2017 commit 163fbdb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion freshclam/freshclam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1504,7 +1504,7 @@ fc_error_t perform_database_update(
const char *startOfFilename = strrchr(urlDatabaseList[i], '/') + 1;
if (NULL != startOfFilename) {
// Add the base database name to the do-not-prune list, excluding the '.cvd' extension.
doNotPruneDatabaseList[nDatabases + i] = CLI_STRNDUP(startOfFilename, strlen(startOfFilename) - strlen(".cvd"));
doNotPruneDatabaseList[nDoNotPruneDatabases] = CLI_STRNDUP(startOfFilename, strlen(startOfFilename) - strlen(".cvd"));
nDoNotPruneDatabases++;
}
}
Expand Down

0 comments on commit 163fbdb

Please sign in to comment.