lib/pubkey2fp.c: CID 62724 (dereference NULL return value)

This commit is contained in:
Juan RP 2014-10-06 08:17:53 +02:00
parent a6f128a578
commit fae4ef0cd6

View File

@ -121,6 +121,8 @@ xbps_pubkey2fp(struct xbps_handle *xhp, xbps_data_t pubkey)
encodingLength++; encodingLength++;
pEncoding = malloc(encodingLength); pEncoding = malloc(encodingLength);
assert(pEncoding);
memcpy(pEncoding, pSshHeader, 11); memcpy(pEncoding, pSshHeader, 11);
index = SshEncodeBuffer(&pEncoding[11], eLen, eBytes); index = SshEncodeBuffer(&pEncoding[11], eLen, eBytes);