mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 13:20:11 +01:00
Avoid possible divide-by-zero warnings.
This commit is contained in:
@@ -317,7 +317,7 @@ int tools_string_to_size(struct crypt_device *cd, const char *s, uint64_t *size)
|
||||
}
|
||||
|
||||
tmp = *size * mult;
|
||||
if ((tmp / *size) != mult) {
|
||||
if (*size && (tmp / *size) != mult) {
|
||||
log_dbg("Device size overflow.");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user