diff options
author | ian.mcgreer%sun.com <devnull@localhost> | 2003-03-24 22:25:52 +0000 |
---|---|---|
committer | ian.mcgreer%sun.com <devnull@localhost> | 2003-03-24 22:25:52 +0000 |
commit | b71b207f95249630fe6a771d2d4103f82df1fb25 (patch) | |
tree | f141d4d62c447bff3c00cee9504c385e5b333638 | |
parent | 65c4ab6e41f4f99a04aafc09eb051f6d1a4c53cc (diff) | |
download | nss-hg-b71b207f95249630fe6a771d2d4103f82df1fb25.tar.gz |
bug 198622, redundant memset calls
-rw-r--r-- | security/nss/lib/freebl/md5.c | 3 | ||||
-rw-r--r-- | security/nss/lib/freebl/prng_fips1861.c | 2 | ||||
-rw-r--r-- | security/nss/lib/freebl/sha_fast.c | 3 |
3 files changed, 4 insertions, 4 deletions
diff --git a/security/nss/lib/freebl/md5.c b/security/nss/lib/freebl/md5.c index c1e55902c..ebdebe351 100644 --- a/security/nss/lib/freebl/md5.c +++ b/security/nss/lib/freebl/md5.c @@ -241,7 +241,8 @@ MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length) MD5Context * MD5_NewContext(void) { - MD5Context *cx = (MD5Context *)PORT_ZAlloc(sizeof(MD5Context)); + /* no need to ZAlloc, MD5_Begin will init the context */ + MD5Context *cx = (MD5Context *)PORT_Alloc(sizeof(MD5Context)); if (cx == NULL) { PORT_SetError(PR_OUT_OF_MEMORY_ERROR); return NULL; diff --git a/security/nss/lib/freebl/prng_fips1861.c b/security/nss/lib/freebl/prng_fips1861.c index bf0199926..3c34ca83b 100644 --- a/security/nss/lib/freebl/prng_fips1861.c +++ b/security/nss/lib/freebl/prng_fips1861.c @@ -166,8 +166,6 @@ alg_fips186_1_x3_1(RNGContext *rng, PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; } - /* initialize the SHA1 context */ - memset(&sha1cx, 0, sizeof(sha1cx)); /* * <Step 2> Initialize t, taken care of in SHA-1 (same initial values) */ diff --git a/security/nss/lib/freebl/sha_fast.c b/security/nss/lib/freebl/sha_fast.c index 52589a5ae..5057d287a 100644 --- a/security/nss/lib/freebl/sha_fast.c +++ b/security/nss/lib/freebl/sha_fast.c @@ -352,7 +352,8 @@ SHA1_NewContext(void) { SHA1Context *cx; - cx = PORT_ZNew(SHA1Context); + /* no need to ZNew, SHA1_Begin will init the context */ + cx = PORT_New(SHA1Context); return cx; } |