Skip to content

Commit

Permalink
Fix overrun in crc32set (netdata#16654)
Browse files Browse the repository at this point in the history
  • Loading branch information
stelfrag authored Dec 21, 2023
1 parent 51129c8 commit f662bf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion database/engine/rrdenginelib.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ static inline int crc32cmp(void *crcp, uLong crc)

static inline void crc32set(void *crcp, uLong crc)
{
memcpy(crcp, &crc, sizeof(crc));
uint32_t store_crc = (uint32_t) crc;
memcpy(crcp, &store_crc, sizeof(store_crc));
}

int check_file_properties(uv_file file, uint64_t *file_size, size_t min_size);
Expand Down

0 comments on commit f662bf6

Please sign in to comment.