lib/wind: find_normalize read past end of array

find_normalize() can under some circumstances read one element
beyond the input array.  The contents are discarded immediately
without further use.

This change prevents the unintended read.

Change-Id: Ia2759a5632d64f7fa6553f879b5bbbf43ba3513e
This commit is contained in:
Jeffrey Altman
2021-11-17 20:00:29 -05:00
parent 8ed48bc54d
commit 357a38fc7f

View File

@@ -227,9 +227,9 @@ find_composition(const uint32_t *in, unsigned in_len)
unsigned i;
if (n % 5 == 0) {
cur = *in++;
if (in_len-- == 0)
return c->val;
cur = *in++;
}
i = cur >> 16;