Skip to content

Commit c094dea

Browse files
author
Lukas Hutak
committed
IPFIX output: fix integer division by zero when creating a file
If the window alignment was enabled but the window size was zero (both are default values), the collector crashed due to division by zero. This fix ignores the alignment if the windows size is zero.
1 parent da91c49 commit c094dea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/output/ipfix/src/IPFIXOutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ IPFIXOutput::new_file(const std::time_t current_time)
8888
close_file();
8989

9090
// Get the timestamp of the file to create
91-
if (config->align_windows) {
91+
if (config->window_size > 0 && config->align_windows) {
9292
// Round down to the nearest multiple of window size
9393
file_start_time = (current_time / config->window_size) * config->window_size;
9494
} else {

0 commit comments

Comments
 (0)