Fix out-of-bounds read in fitness_all().

This commit is contained in:
Daniel Beer 2017-03-30 18:05:49 +13:00
parent a5513dc49d
commit 84eccbf077

View file

@ -773,7 +773,7 @@ static int fitness_all(const struct quirc *q, int index)
/* Check alignment patterns */
ap_count = 0;
while (info->apat[ap_count])
while ((ap_count < QUIRC_MAX_ALIGNMENT) && info->apat[ap_count])
ap_count++;
for (i = 1; i + 1 < ap_count; i++) {