diff options
Diffstat (limited to 'elf/tst-stackguard1.c')
-rw-r--r-- | elf/tst-stackguard1.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/elf/tst-stackguard1.c b/elf/tst-stackguard1.c index 480f9297d0..ed1b5687a2 100644 --- a/elf/tst-stackguard1.c +++ b/elf/tst-stackguard1.c @@ -160,17 +160,21 @@ do_test (void) the 16 runs, something is very wrong. */ int ndifferences = 0; int ndefaults = 0; + int npartlyrandomized = 0; for (i = 0; i < N; ++i) { if (child_stack_chk_guards[i] != child_stack_chk_guards[i+1]) ndifferences++; else if (child_stack_chk_guards[i] == default_guard) ndefaults++; + else if (*(char *) &child_stack_chk_guards[i] == 0) + npartlyrandomized = 0; } - printf ("differences %d defaults %d\n", ndifferences, ndefaults); + printf ("differences %d defaults %d partly randomized %d\n", + ndifferences, ndefaults, npartlyrandomized); - if (ndifferences < N / 2 && ndefaults < N / 2) + if ((ndifferences + ndefaults + npartlyrandomized) < 3 * N / 4) { puts ("stack guard canaries are not randomized enough"); puts ("nor equal to the default canary value"); |