Mercurial > dropbear
comparison dbhelpers.c @ 1374:4b1a807a3188 fuzz
Just use memset, it should'be be optimised out in a separate file
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 May 2017 22:19:46 +0800 |
parents | 3017bc7d6238 |
children | 119a459b00d0 |
comparison
equal
deleted
inserted
replaced
1373:9891bc31a1b3 | 1374:4b1a807a3188 |
---|---|
7 #if defined(HAVE_MEMSET_S) | 7 #if defined(HAVE_MEMSET_S) |
8 memset_s(data, len, 0x0, len); | 8 memset_s(data, len, 0x0, len); |
9 #elif defined(HAVE_EXPLICIT_BZERO) | 9 #elif defined(HAVE_EXPLICIT_BZERO) |
10 explicit_bzero(data, len); | 10 explicit_bzero(data, len); |
11 #else | 11 #else |
12 /* Based on the method in David Wheeler's | 12 volatile void *p = data; |
13 * "Secure Programming for Linux and Unix HOWTO". May not be safe | 13 memset(p, 0x0, len); |
14 * against link-time optimisation. */ | |
15 volatile char *p = data; | |
16 | |
17 if (data == NULL) | |
18 return; | |
19 while (len--) { | |
20 *p++ = 0x0; | |
21 } | |
22 #endif | 14 #endif |
23 } | 15 } |
24 | 16 |
25 | 17 |