From 77202a85a0c9cf8f72bfaf02c5f8e4721fbd6ce0 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Sat, 7 Mar 2009 17:00:23 +0000 Subject: Update from stable branch. --- crypto/bio/bss_mem.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'crypto/bio/bss_mem.c') diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c index e18f4bc695..37d4194e4b 100644 --- a/crypto/bio/bss_mem.c +++ b/crypto/bio/bss_mem.c @@ -280,6 +280,7 @@ static int mem_gets(BIO *bp, char *buf, int size) BIO_clear_retry_flags(bp); j=bm->length; + if ((size-1) < j) j=size-1; if (j <= 0) { *buf='\0'; @@ -288,17 +289,18 @@ static int mem_gets(BIO *bp, char *buf, int size) p=bm->data; for (i=0; i 0) buf[i]='\0'; ret=i; -- cgit v1.2.3