[repacker] validate link widths during repacker setup.
This commit is contained in:
parent
edf7a29595
commit
9e99d08470
|
@ -58,6 +58,13 @@ struct graph_t
|
||||||
unsigned start = l.position;
|
unsigned start = l.position;
|
||||||
unsigned end = start + l.width - 1;
|
unsigned end = start + l.width - 1;
|
||||||
|
|
||||||
|
if (unlikely (l.width < 2 || l.width > 4))
|
||||||
|
{
|
||||||
|
DEBUG_MSG (SUBSET_REPACK, nullptr,
|
||||||
|
"Invalid graph. Invalid link width.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely (end >= table_size ()))
|
if (unlikely (end >= table_size ()))
|
||||||
{
|
{
|
||||||
DEBUG_MSG (SUBSET_REPACK, nullptr,
|
DEBUG_MSG (SUBSET_REPACK, nullptr,
|
||||||
|
|
|
@ -111,8 +111,6 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size)
|
||||||
if (links[i].parent >= num_objects
|
if (links[i].parent >= num_objects
|
||||||
|| links[i].child > links[i].parent) // Enforces DAG graph
|
|| links[i].child > links[i].parent) // Enforces DAG graph
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (links[i].width < 2 || links[i].width > 4) goto end;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_links_to_objects (objects, num_objects,
|
add_links_to_objects (objects, num_objects,
|
||||||
|
|
Loading…
Reference in New Issue