Fixes and workarounds for some Coverity scan reports.

This commit is contained in:
Milan Broz
2018-04-30 12:26:12 +02:00
parent 7fede3ee45
commit 2a1a773777
7 changed files with 23 additions and 11 deletions

View File

@@ -966,6 +966,7 @@ static int action_luksFormat(void)
return -EPERM;
log_dbg("Creating header file.");
/* coverity[toctou] */
fd = open(opt_header_device, O_CREAT|O_EXCL|O_WRONLY, S_IRUSR|S_IWUSR);
if (fd == -1 || posix_fallocate(fd, 0, 4096))
log_err(_("Cannot create header file %s."), opt_header_device);