diff options
Diffstat (limited to 'nptl')
-rw-r--r-- | nptl/ChangeLog | 5 | ||||
-rw-r--r-- | nptl/tst-stackguard1.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 0128865672..38983a81d1 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,8 @@ +2005-07-29 Jakub Jelinek <jakub@redhat.com> + + * tst-stackguard1.c (do_test): Don't fail if the poor man's + randomization doesn't work well enough. + 2005-07-11 Jakub Jelinek <jakub@redhat.com> [BZ #1102] diff --git a/nptl/tst-stackguard1.c b/nptl/tst-stackguard1.c index 15c30aeb6b..d9bbe206c3 100644 --- a/nptl/tst-stackguard1.c +++ b/nptl/tst-stackguard1.c @@ -190,17 +190,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"); |