From 606c8048a08d424663ff69045ba3f657a3e38d72 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 11 Jun 2003 18:43:45 +0000 Subject: Make sure to NUL-terminate the string on end-of-file (and error) PR: 643 --- crypto/bio/bf_buff.c | 1 + 1 file changed, 1 insertion(+) (limited to 'crypto') 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); } -- cgit v1.2.3