mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Avoid zero-length read in read_lseek_blockwise
Found by Valgrind. Similar fix already exists for write_lseek_blockwise.
This commit is contained in:
@@ -278,7 +278,7 @@ ssize_t read_lseek_blockwise(int fd, size_t bsize, size_t alignment,
|
|||||||
length -= innerCount;
|
length -= innerCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = read_blockwise(fd, bsize, alignment, buf, length);
|
ret = length ? read_blockwise(fd, bsize, alignment, buf, length) : 0;
|
||||||
if (ret >= 0)
|
if (ret >= 0)
|
||||||
ret += innerCount;
|
ret += innerCount;
|
||||||
out:
|
out:
|
||||||
|
|||||||
Reference in New Issue
Block a user