mirror of
https://github.com/openssl/openssl.git
synced 2025-03-25 20:00:44 +08:00
Do not eat trailing '\n' in BIO_gets for fd BIO.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3442)
This commit is contained in:
parent
62f218cb8d
commit
79b35228f1
@ -207,8 +207,10 @@ static int fd_gets(BIO *bp, char *buf, int size)
|
||||
char *ptr = buf;
|
||||
char *end = buf + size - 1;
|
||||
|
||||
while ((ptr < end) && (fd_read(bp, ptr, 1) > 0) && (ptr[0] != '\n'))
|
||||
ptr++;
|
||||
while (ptr < end && fd_read(bp, ptr, 1) > 0) {
|
||||
if (*ptr++ == '\n')
|
||||
break;
|
||||
}
|
||||
|
||||
ptr[0] = '\0';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user