Skip to content

Commit

Permalink
Add protection against zip bom when creating log zip archive.
Browse files Browse the repository at this point in the history
  • Loading branch information
herve-er committed Apr 19, 2024
1 parent 9dd1f32 commit badd71e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcommonserver/log/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ bool Log::generateLogsSupportArchive(bool includeOldLogs, const SyncPath &output

// Generate the archive
int err = 0;
zip_t *archive = zip_open((logPath / "send_log_directory_temp" / archiveName).string().c_str(), ZIP_CREATE, &err);
zip_t *archive = zip_open((logPath / "send_log_directory_temp" / archiveName).string().c_str(), ZIP_CREATE | ZIP_EXCL, &err);
if (err != ZIP_ER_OK) {
LOG_WARN(Log::instance()->getLogger(), "Error in zip_open : " << zip_strerror(archive));
LOG_WARN(Log::instance()->getLogger(), "Error in zip_open : " << err);
Expand Down

0 comments on commit badd71e

Please sign in to comment.