1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Corrects fixed buffer size error in FileHolder::check_signature.

This commit is contained in:
Thomas Harte 2017-11-03 21:43:31 -04:00
parent 23d5849cda
commit 794437f20f

View File

@ -152,9 +152,9 @@ bool FileHolder::check_signature(const char *signature, size_t length) {
if(!length) length = strlen(signature);
// read and check the file signature
char stored_signature[12];
if(fread(stored_signature, 1, length, file_) != length) return false;
if(memcmp(stored_signature, signature, length)) return false;
std::vector<uint8_t> stored_signature = read(length);
if(stored_signature.size() != length) return false;
if(memcmp(stored_signature.data(), signature, length)) return false;
return true;
}