mtrojnar / osslsigncode

OpenSSL based Authenticode signing for PE/MSI/Java CAB files
Other
731 stars 124 forks source link

unmap_file take address but file name is passed #319

Closed ambrisko closed 7 months ago

ambrisko commented 7 months ago

In helpers.c void unmap_file(char indata, const size_t size) but various usages are: grep unmap_file .c | grep -v indata cab.c: unmap_file(options->infile, filesize); cab.c: unmap_file(options->infile, filesize); cat.c: unmap_file(options->infile, filesize); cat.c: unmap_file(options->infile, filesize); msi.c: unmap_file(options->infile, filesize); msi.c: unmap_file(options->infile, filesize); pe.c: unmap_file(options->infile, filesize); pe.c: unmap_file(options->infile, filesize); Some are okay: grep unmap_file .c | grep indata cab.c: unmap_file(ctx->options->indata, ctx->cab_ctx->fileend); cat.c: unmap_file(ctx->options->indata, ctx->cat_ctx->fileend); helpers.c:void unmap_file(char indata, const size_t size) helpers.c: unmap_file(indata, filesize); msi.c: unmap_file(ctx->options->indata, ctx->msi_ctx->fileend); pe.c: unmap_file(ctx->options->indata, ctx->pe_ctx->fileend);

On FreeBSD this leads to a seg. fault on verify test, when the MSI magic check fails and then does unmap_file(options->infile, filesize) instead of unmap_file(options->indata, filesize). RedHat and under gdb let's it pass.