mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Fix return code for ssize_t.
The ssize_t must be defined in the range [-1, SSIZE_MAX]. The return value is overwritten to -EINVAL later anyway, return -1 here to be on the safe side. Fixes: #900
This commit is contained in:
@@ -99,7 +99,7 @@ static ssize_t read_tty_eol(int fd, char *pass, size_t maxlen)
|
||||
ssize_t r, read_size = 0;
|
||||
|
||||
if (maxlen > SSIZE_MAX)
|
||||
return -EINVAL;
|
||||
return -1;
|
||||
|
||||
do {
|
||||
r = read(fd, pass, maxlen - read_size);
|
||||
|
||||
Reference in New Issue
Block a user