From: Richard Levitte Date: Wed, 11 Jun 2003 18:43:45 +0000 (+0000) Subject: Make sure to NUL-terminate the string on end-of-file (and error) X-Git-Tag: BEN_FIPS_TEST_1~38^2~67 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=606c8048a08d424663ff69045ba3f657a3e38d72 Make sure to NUL-terminate the string on end-of-file (and error) PR: 643 --- diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c index 1cecd70579..c1fd75aaad 100644 --- a/crypto/bio/bf_buff.c +++ b/crypto/bio/bf_buff.c @@ -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); }