Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Jul 25, 2023
1 parent 071971f commit 82607d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libclamav/udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,26 +60,28 @@ static cl_error_t writeWholeFile(cli_ctx *ctx, const char *const fileName, const
}

if (cli_writen(fd, data, dataLen) != dataLen) {
cli_warnmsg("iso_scan_file: Can't write to file %s\n", tmpf);
cli_warnmsg("writeWholeFile: Can't write to file %s\n", tmpf);
status = CL_EWRITE;
goto done;
}

status = cli_magic_scan_desc(fd, tmpf, ctx, fileName, LAYER_ATTRIBUTES_NONE);

close(fd);
done:
if (-1 != fd){
close(fd);
fd = -1;
}
if (!ctx->engine->keeptmp) {
if (cli_unlink(tmpf)) {
/* If status is already set to virus or something, that should take priority of the
* error unlinking the file. */
if (CL_CLEAN == status) {
status = CL_EUNLINK;
}
goto done;
}
}

done:
FREE(tmpf);

return status;
Expand Down

0 comments on commit 82607d1

Please sign in to comment.