mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Corrects fixed buffer size error in FileHolder::check_signature
.
This commit is contained in:
parent
23d5849cda
commit
794437f20f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user