diff options
author | ian.mcgreer%sun.com <devnull@localhost> | 2003-04-17 17:05:09 +0000 |
---|---|---|
committer | ian.mcgreer%sun.com <devnull@localhost> | 2003-04-17 17:05:09 +0000 |
commit | eb83618dd312ae6971dadf39a0aa27038caee1de (patch) | |
tree | e5767bf96d9d177a19d66d8d61b6c9319601d4d0 /security/nss/lib/softoken/pkcs11c.c | |
parent | db11c3e6a1b4e2abb69543ee5ff25894527300cb (diff) | |
download | nss-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.c | 14 |
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) { |