Ensure that atom length is not larger than YR_MAX_ATOM_LENGTH.
@@ -117,6 +117,8 @@ int yr_atoms_heuristic_quality(
int i, j;
bool is_unique;
+ assert(atom->length <= YR_MAX_ATOM_LENGTH);
+
for (i = 0; i < atom->length; i++)
{
switch (atom->mask[i])
@@ -190,6 +192,8 @@ int yr_atoms_table_quality(
int begin = 0;
int end = config->quality_table_entries;
+ assert(atom->length <= YR_MAX_ATOM_LENGTH);
+
while (end > begin)
{
int middle = begin + (end - begin) / 2;
