~ubuntu-branches/ubuntu/natty/eglibc/natty-security

« back to all changes in this revision

Viewing changes to string/test-memchr.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-08-03 10:17:12 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20090803101712-n74r7xge7cwubmka
Tags: upstream-2.10.1
ImportĀ upstreamĀ versionĀ 2.10.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Test and measure memchr functions.
2
 
   Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
 
2
   Copyright (C) 1999, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
3
3
   This file is part of the GNU C Library.
4
4
   Written by Jakub Jelinek <jakub@redhat.com>, 1999.
5
5
 
144
144
        }
145
145
 
146
146
      if (pos < len)
147
 
        result = (char *) (p + pos + align);
 
147
        {
 
148
          size_t r = random ();
 
149
          if ((r & 31) == 0)
 
150
            len = ~(uintptr_t) (p + align) - ((r >> 5) & 31);
 
151
          result = (char *) (p + pos + align);
 
152
        }
148
153
      else
149
154
        result = NULL;
150
155