Skip to content

Commit

Permalink
AP_Filesystem: crc32: Ensure checksum value is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
IamPete1 committed Feb 14, 2024
1 parent 140ba38 commit 3f0a952
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libraries/AP_Filesystem/AP_Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ bool AP_Filesystem::fgets(char *buf, uint8_t buflen, int fd)
// run crc32 over file with given name, returns true if successful
bool AP_Filesystem::crc32(const char *fname, uint32_t& checksum)
{
// Ensure value is initialized
checksum = 0;

// Open file in readonly mode
int fd = open(fname, O_RDONLY);
if (fd == -1) {
Expand Down

0 comments on commit 3f0a952

Please sign in to comment.