mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Get rid of off_t integers and use uint64_t.
Also move uint64 multiplication overflow check to internal library.
This commit is contained in:
@@ -240,4 +240,12 @@ int crypt_compare_dm_devices(struct crypt_device *cd,
|
||||
const struct crypt_dm_active_device *tgt);
|
||||
static inline void *crypt_zalloc(size_t size) { return calloc(1, size); }
|
||||
|
||||
static inline bool uint64_mult_overflow(uint64_t *u, uint64_t b, size_t size)
|
||||
{
|
||||
*u = (uint64_t)b * size;
|
||||
if ((uint64_t)(*u / size) != b)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* INTERNAL_H */
|
||||
|
||||
Reference in New Issue
Block a user