summaryrefslogtreecommitdiff
path: root/security/nss/lib/softoken/pkcs11c.c
diff options
context:
space:
mode:
authorian.mcgreer%sun.com <devnull@localhost>2003-04-17 17:05:09 +0000
committerian.mcgreer%sun.com <devnull@localhost>2003-04-17 17:05:09 +0000
commiteb83618dd312ae6971dadf39a0aa27038caee1de (patch)
treee5767bf96d9d177a19d66d8d61b6c9319601d4d0 /security/nss/lib/softoken/pkcs11c.c
parentdb11c3e6a1b4e2abb69543ee5ff25894527300cb (diff)
downloadnss-hg-eb83618dd312ae6971dadf39a0aa27038caee1de.tar.gz
bug 198452, zero-byte memcpys
r=relyea
Diffstat (limited to 'security/nss/lib/softoken/pkcs11c.c')
-rw-r--r--security/nss/lib/softoken/pkcs11c.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/security/nss/lib/softoken/pkcs11c.c b/security/nss/lib/softoken/pkcs11c.c
index 82da04d16..604071159 100644
--- a/security/nss/lib/softoken/pkcs11c.c
+++ b/security/nss/lib/softoken/pkcs11c.c
@@ -4481,14 +4481,20 @@ CK_RV NSC_DeriveKey( CK_SESSION_HANDLE hSession,
/*
** client_write_IV[CipherSpec.IV_size]
*/
- PORT_Memcpy(ssl3_keys_out->pIVClient, &key_block[i], IVSize);
- i += IVSize;
+ if (IVSize > 0) {
+ PORT_Memcpy(ssl3_keys_out->pIVClient,
+ &key_block[i], IVSize);
+ i += IVSize;
+ }
/*
** server_write_IV[CipherSpec.IV_size]
*/
- PORT_Memcpy(ssl3_keys_out->pIVServer, &key_block[i], IVSize);
- i += IVSize;
+ if (IVSize > 0) {
+ PORT_Memcpy(ssl3_keys_out->pIVServer,
+ &key_block[i], IVSize);
+ i += IVSize;
+ }
PORT_Assert(i <= sizeof key_block);
} else if (!isTLS) {