From: Dr. Stephen Henson Date: Sat, 7 Mar 2009 17:00:23 +0000 (+0000) Subject: Update from stable branch. X-Git-Tag: OpenSSL_0_9_8k^2~20 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=77202a85a0c9cf8f72bfaf02c5f8e4721fbd6ce0;p=oweals%2Fopenssl.git Update from stable branch. --- diff --git a/CHANGES b/CHANGES index bee9941a0c..695ed97479 100644 --- a/CHANGES +++ b/CHANGES @@ -745,6 +745,10 @@ Changes between 0.9.8j and 0.9.8k [xx XXX xxxx] + *) Improve efficiency of mem_gets: don't search whole buffer each time + for a '\n' + [Jeremy Shapiro ] + *) New -hex option for openssl rand. [Matthieu Herrb] 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;