Skip to content

Thread return value cast causes weird unsigned integer underflow #1767

@Robotechnic

Description

@Robotechnic

I stumbled accross a wierd overflow that souldn't happen.
With this code:

int main() {
	int *buff = 0;
	return buff[5];
}

And those parameters:

--ana.arrayoob true --ana.int.interval_set true --ana.base.arrays.domain partitioned --ana.base.arrays.nullbytes true --sem.malloc.fail true --set "ana.activated[+]" memOutOfBounds --set "ana.activated[+]"  useAfterFree

I get the following error message:

[Warning][Integer > Overflow][CWE-190][CWE-191] Unsigned integer overflow and underflow (... .c:6:9-6:16)

But for me, it shouldn't happen as a possibly random value set by the OS, can't be an overflow value. Let alone for an unsigned integer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    precisionsv-compSV-COMP (analyses, results), witnesses

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions