mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
Make sure to NUL-terminate the string on end-of-file (and error)
PR: 643
This commit is contained in:
parent
e66d863cd0
commit
606c8048a0
@ -494,6 +494,7 @@ static int buffer_gets(BIO *b, char *buf, int size)
|
||||
if (i <= 0)
|
||||
{
|
||||
BIO_copy_next_retry(b);
|
||||
*buf='\0';
|
||||
if (i < 0) return((num > 0)?num:i);
|
||||
if (i == 0) return(num);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user