Pádraig Brady <[email protected]> writes:

> With an ASAN build we can trigger the issue like:
>
>   $ src/factor 22486472939460651857
>   src/factor.c:888:36: runtime error:
>   index 675 out of bounds for type 'int_least16_t [675]'
>
> * src/factor.c (factor_using_division): Guard the final unrolled block
> before reading a subsequent prime.
> * tests/factor/factor.pl: Add a test case.
> * NEWS: Mention the bug fix.
> Problem caught by Coverity analysis.
> ---
>  NEWS                   | 3 +++
>  src/factor.c           | 2 ++
>  tests/factor/factor.pl | 2 ++
>  3 files changed, 7 insertions(+)

Nice work and thanks.

I have been looking at cleaning up some of the old Coverity reports
recently as well. But I was mostly focused on cleaning up the cases
where Coverity was being a bit too sensitive.

I saw this one, but didn't think about it long enough to come up with a
reproducer.

Collin

Reply via email to