From: Eugene Syromyatnikov Date: Sun, 30 Oct 2016 19:27:55 +0000 (+0300) Subject: tests: fix invalid pointer checks in getcpu test X-Git-Tag: v4.15~160 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fb04c6aeca7151814a0eb7fcc469dd44e475957;p=strace tests: fix invalid pointer checks in getcpu test * test/getcpu.c (main): Replace magic numbers deemed invalid pointers with addresses after memory returned by tail_alloc. --- diff --git a/tests/getcpu.c b/tests/getcpu.c index baef1bb4..661840c5 100644 --- a/tests/getcpu.c +++ b/tests/getcpu.c @@ -39,12 +39,12 @@ int main(void) { - static const unsigned *bogus_cpu = - (unsigned *) (unsigned long) 0xfffffeedfffffaceULL; - static const unsigned *bogus_node = - (unsigned *) (unsigned long) 0xfffffca7ffffc0deULL; - static const unsigned *bogus_tcache = - (unsigned *) (unsigned long) 0xffffda7affffdeadULL; + unsigned *bogus_cpu = + (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + unsigned *bogus_node = + (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + unsigned *bogus_tcache = + (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; long res; unsigned *cpu = tail_alloc(sizeof(*cpu));