mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-19 14:01:10 +01:00
[fuzzer] Fix hb-set-fuzzer minor overflow issue
Size shouldn't be smaller than the struct not its pointer size. Fixes https://crbug.com/oss-fuzz/20655
This commit is contained in:
1 parent
7b42403c1c
commit
97229244eb
2 files changed
+5
-4
No files matched your search
@@ -0,0 +1 @@
|
||||
|
||||
@@ -33,15 +33,15 @@ static hb_set_t* create_set (const uint32_t* value_array, int count)
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
||||
{
|
||||
if (size < sizeof(instructions_t*))
|
||||
if (size < sizeof (instructions_t))
|
||||
return 0;
|
||||
|
||||
const instructions_t* instructions = reinterpret_cast<const instructions_t*> (data);
|
||||
data += sizeof(instructions_t);
|
||||
size -= sizeof(instructions_t);
|
||||
data += sizeof (instructions_t);
|
||||
size -= sizeof (instructions_t);
|
||||
|
||||
const uint32_t* values = reinterpret_cast<const uint32_t*> (data);
|
||||
size = size / sizeof(uint32_t);
|
||||
size = size / sizeof (uint32_t);
|
||||
|
||||
if (size < instructions->first_set_size)
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user