mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-04 16:25:25 +00:00
Fixed a bug that caused an infinite loop when the password timeout was disabled.
This commit is contained in:
@@ -223,7 +223,7 @@ tgetline(fd, buf, bufsiz, timeout)
|
|||||||
free(readfds);
|
free(readfds);
|
||||||
} else {
|
} else {
|
||||||
/* Keep reading until out of space, EOF, error, or newline */
|
/* Keep reading until out of space, EOF, error, or newline */
|
||||||
while (--left && (n = read(fd, &c, 1)) == 1 && (c != '\n' || c != '\r'))
|
while (--left && (n = read(fd, &c, 1)) == 1 && c != '\n' && c != '\r')
|
||||||
*cp++ = c;
|
*cp++ = c;
|
||||||
}
|
}
|
||||||
*cp = '\0';
|
*cp = '\0';
|
||||||
|
Reference in New Issue
Block a user