Skip to content

Commit

Permalink
in_winevtlog: change total_size_threshold to size_t (#8853)
Browse files Browse the repository at this point in the history
The `total_size_threshold` field was originally an unsigned int. The
field in the config map uses `FLB_CONFIG_MAP_SIZE`, which reads the
value as a `size_t` and then writes it to the offset of the field in the
struct. On a 64-bit machine, this is 8 bytes. This means the 8 byte
value would be written at this offset, as a result overriding the value
of the next struct field. This would cause `string_inserts` with default
values to end up being `false` when it should be `true`.

This PR changes `total_size_threshold` to a `size_t`. This seems
consistent with other usages of `FLB_CONFIG_MAP_SIZE` that I was able to
find.

Signed-off-by: braydonk <[email protected]>
  • Loading branch information
braydonk authored May 23, 2024
1 parent 928c254 commit 7ac7d50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/in_winevtlog/winevtlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
struct winevtlog_config {
unsigned int interval_sec;
unsigned int interval_nsec;
unsigned int total_size_threshold;
size_t total_size_threshold;
int string_inserts;
int read_existing_events;
int render_event_as_xml;
Expand Down

0 comments on commit 7ac7d50

Please sign in to comment.