aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/bf_buff.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-06-11 18:43:45 +0000
committerRichard Levitte <levitte@openssl.org>2003-06-11 18:43:45 +0000
commit606c8048a08d424663ff69045ba3f657a3e38d72 (patch)
treeb0c9b7fbe1a0ff9c622fe0995b724e4f036a558f /crypto/bio/bf_buff.c
parente66d863cd0f0b09a375c2fc9bff7bfd1e9c3a2a2 (diff)
downloadopenssl-606c8048a08d424663ff69045ba3f657a3e38d72.tar.gz
Make sure to NUL-terminate the string on end-of-file (and error)
PR: 643
Diffstat (limited to 'crypto/bio/bf_buff.c')
-rw-r--r--crypto/bio/bf_buff.c1
1 files changed, 1 insertions, 0 deletions
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);
}