~ubuntu-branches/ubuntu/karmic/openssl/karmic-proposed

« back to all changes in this revision

Viewing changes to crypto/mem_clr.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-12-05 00:13:39 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20071205001339-tazlol313zs8u6ec
Tags: 0.9.8g-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure: Add support for lpia.
  - Replace duplicate files in the doc directory with symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
void OPENSSL_cleanse(void *ptr, size_t len)
65
65
        {
66
66
        unsigned char *p = ptr;
67
 
        size_t loop = len;
 
67
        size_t loop = len, ctr = cleanse_ctr;
68
68
        while(loop--)
69
69
                {
70
 
                *(p++) = cleanse_ctr;
71
 
                cleanse_ctr += (17 + (unsigned char)((unsigned long)p & 0xF));
 
70
                *(p++) = (unsigned char)ctr;
 
71
                ctr += (17 + ((size_t)p & 0xF));
72
72
                }
73
 
        if(memchr(ptr, cleanse_ctr, len))
74
 
                cleanse_ctr += 63;
 
73
        p=memchr(ptr, (unsigned char)ctr, len);
 
74
        if(p)
 
75
                ctr += (63 + (size_t)p);
 
76
        cleanse_ctr = (unsigned char)ctr;
75
77
        }