Fixed unmap_file() segmentation fault

This commit is contained in:
olszomal
2023-11-21 09:39:52 +01:00
committed by Michał Trojnara
parent 0db17be606
commit 8a9b275494
4 changed files with 8 additions and 8 deletions

4
pe.c
View File

@ -112,12 +112,12 @@ static FILE_FORMAT_CTX *pe_ctx_new(GLOBAL_OPTIONS *options, BIO *hash, BIO *outd
return NULL; /* FAILED */
}
if (memcmp(options->indata, "MZ", 2)) {
unmap_file(options->infile, filesize);
unmap_file(options->indata, filesize);
return NULL; /* FAILED */
}
pe_ctx = pe_ctx_get(options->indata, filesize);
if (!pe_ctx) {
unmap_file(options->infile, filesize);
unmap_file(options->indata, filesize);
return NULL; /* FAILED */
}
ctx = OPENSSL_malloc(sizeof(FILE_FORMAT_CTX));