Skip to content

libdivsufsort-lite crashes #3

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. 32-bit OS, with 2 Gb RAM or more
2. Take a file with size>=1Gb i.e. (1<<30) bytes
3. Run libdivsufsort-lite.exe BIGFILE

What is the expected output? What do you see instead?

Expected behaviour:
> sufcheck: Done.
It simply crashes instead.

What version of the product are you using? On what operating system?

libdivsufsort-lite 2.0.0 on Windows XP with 3 GB RAM.

Please provide any additional information below.

It crashes because of overflow in suftest.c , line 163:

>  SA = (int *)malloc((size_t)n * sizeof(int));

if (sizeof(size_t)==4 && sizeof(int)==4 && n>=(1<<30))
then ((size_t)n * sizeof(int))==((n&4)&((1<<32)-1))


Original issue reported on code.google.com by [email protected] on 3 Oct 2011 at 1:34

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions