mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-04 17:00:11 -05:00
Fix resource leak, CID 1530764, 1530765
This commit is contained in:
parent
5fef4faf47
commit
29843ccf40
@ -1609,8 +1609,6 @@ static u_char *pe_calc_page_hash(char *indata, uint32_t header_size,
|
|||||||
}
|
}
|
||||||
pphlen = 4 + EVP_MD_size(md);
|
pphlen = 4 + EVP_MD_size(md);
|
||||||
phlen = pphlen * (3 + (int)nsections + (int)(sigpos / pagesize));
|
phlen = pphlen * (3 + (int)nsections + (int)(sigpos / pagesize));
|
||||||
res = OPENSSL_malloc((size_t)phlen);
|
|
||||||
zeroes = OPENSSL_zalloc((size_t)pagesize);
|
|
||||||
|
|
||||||
mdctx = EVP_MD_CTX_new();
|
mdctx = EVP_MD_CTX_new();
|
||||||
if (!EVP_DigestInit(mdctx, md)) {
|
if (!EVP_DigestInit(mdctx, md)) {
|
||||||
@ -1618,6 +1616,8 @@ static u_char *pe_calc_page_hash(char *indata, uint32_t header_size,
|
|||||||
printf("Unable to set up the digest context\n");
|
printf("Unable to set up the digest context\n");
|
||||||
return NULL; /* FAILED */
|
return NULL; /* FAILED */
|
||||||
}
|
}
|
||||||
|
res = OPENSSL_malloc((size_t)phlen);
|
||||||
|
zeroes = OPENSSL_zalloc((size_t)pagesize);
|
||||||
EVP_DigestUpdate(mdctx, indata, header_size + 88);
|
EVP_DigestUpdate(mdctx, indata, header_size + 88);
|
||||||
EVP_DigestUpdate(mdctx, indata + header_size + 92, 60 + pe32plus*16);
|
EVP_DigestUpdate(mdctx, indata + header_size + 92, 60 + pe32plus*16);
|
||||||
EVP_DigestUpdate(mdctx, indata + header_size + 160 + pe32plus*16,
|
EVP_DigestUpdate(mdctx, indata + header_size + 160 + pe32plus*16,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user