too much read from kernel flash for checksum validation

This commit is contained in:
2021-11-09 14:10:15 +01:00
parent 6569e4a8bf
commit bf778b5336
2 changed files with 11 additions and 5 deletions

View File

@@ -360,6 +360,10 @@ int verifyChecksumFromFlash(char *mess, char *functionType,
("\tReached %lu bytes. Not reading more\n", totalBytesRead));
break;
}
// for less than 128 bytes
if ((readUnitSize + totalBytesRead) > fsize) {
readUnitSize = fsize - totalBytesRead;
}
bytes = fread(buf, 1, readUnitSize, fp);
totalBytesRead += bytes;
}