mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-11 10:50:01 +01:00
Do not copy buffer if read fails.
This commit is contained in:
@@ -184,7 +184,8 @@ ssize_t read_blockwise(int fd, size_t bsize, size_t alignment,
|
||||
out:
|
||||
free(hangover_buf);
|
||||
if (buf != orig_buf) {
|
||||
memcpy(orig_buf, buf, length);
|
||||
if (ret == length)
|
||||
memcpy(orig_buf, buf, length);
|
||||
free(buf);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user