X-Git-Url: http://git.droids-corp.org/?p=protos%2Flibecoli.git;a=blobdiff_plain;f=src%2Fecoli_malloc.c;fp=src%2Fecoli_malloc.c;h=e7f02dfc5afe24704dbe9c4c9afc3950a866d431;hp=5a022ae9c1a75c2ed28f77f1c459b489342ff3cc;hb=3d5469a2684f9b2e86ca0875187b9d11c117b39c;hpb=e18710da81b4c53b357dde2ca55005344edc314f diff --git a/src/ecoli_malloc.c b/src/ecoli_malloc.c index 5a022ae..e7f02df 100644 --- a/src/ecoli_malloc.c +++ b/src/ecoli_malloc.c @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -164,7 +165,10 @@ static int ec_malloc_testcase(void) ec_free_func(ptr); ptr = NULL; - ptr = ec_calloc(2, (size_t)-1); + /* here we use atoll() instead of a constant because we want to + * prevent the compiler to check the overflow at compilation + * time */ + ptr = ec_calloc(2, atoll("0xffffffffffffffff")); EC_TEST_CHECK(ptr == NULL, "bad overflow check in ec_calloc\n"); return testres;