fix signer memory takeover on malformed data

pull/772/head
toddouska 2017-03-01 10:25:54 -08:00
parent b86dfd582f
commit 2d612da9f4
1 changed files with 8 additions and 4 deletions

View File

@ -3354,10 +3354,14 @@ int AddCA(WOLFSSL_CERT_MANAGER* cm, DerBuffer** pDer, int type, int verify)
ret = MEMORY_ERROR; ret = MEMORY_ERROR;
else { else {
signer->keyOID = cert->keyOID; signer->keyOID = cert->keyOID;
signer->publicKey = cert->publicKey; if (cert->pubKeyStored) {
signer->pubKeySize = cert->pubKeySize; signer->publicKey = cert->publicKey;
signer->nameLen = cert->subjectCNLen; signer->pubKeySize = cert->pubKeySize;
signer->name = cert->subjectCN; }
if (cert->subjectCNStored) {
signer->nameLen = cert->subjectCNLen;
signer->name = cert->subjectCN;
}
signer->pathLength = cert->pathLength; signer->pathLength = cert->pathLength;
signer->pathLengthSet = cert->pathLengthSet; signer->pathLengthSet = cert->pathLengthSet;
#ifndef IGNORE_NAME_CONSTRAINTS #ifndef IGNORE_NAME_CONSTRAINTS