Avoid possible divide-by-zero warnings.

This commit is contained in:
Milan Broz
2016-04-24 12:38:19 +02:00
parent 1f51cfcf57
commit 7eba57b4c0
2 changed files with 4 additions and 1 deletions

View File

@@ -723,6 +723,9 @@ int TCRYPT_activate(struct crypt_device *cd,
if (!algs)
return -EINVAL;
if (hdr->d.sector_size == 0)
return -EINVAL;
if (params->flags & CRYPT_TCRYPT_SYSTEM_HEADER)
dmd.size = 0;
else if (params->flags & CRYPT_TCRYPT_HIDDEN_HEADER)