]> sigrok.org Git - libsigrok.git/commit - src/analog.c
Fix read past end of array in sr_analog_si_prefix_friendly.
authorMartin Ling <redacted>
Thu, 20 Sep 2018 00:45:22 +0000 (01:45 +0100)
committerUwe Hermann <redacted>
Thu, 20 Sep 2018 18:35:42 +0000 (20:35 +0200)
commit5e5fde6e2c3aabfc61bcd35a53ab0d401b2176ba
treebe5589eb7e9a3c273fd1dc90000ed18389cb5874
parent755793e991c4d429f99254f23008bfddb89d8e00
Fix read past end of array in sr_analog_si_prefix_friendly.

In the case where the input unit was not in the array, the for loop would
complete, but the following test would then read past the end of the array
since 'i' would already have been incremented to the array size.

Spotted because unitless data was getting SI prefixes with no unit, though
this would not have been deterministically reproducible.

This fixes parts of bug #950.
src/analog.c