summaryrefslogtreecommitdiffstats
path: root/crypto/buffer/buffer.c
diff options
context:
space:
mode:
authorRalf S. Engelschall <rse@openssl.org>1998-12-21 10:56:39 +0000
committerRalf S. Engelschall <rse@openssl.org>1998-12-21 10:56:39 +0000
commit58964a492275ca9a59a0cd9c8155cb2491b4b909 (patch)
treec7b16876a5789463bbbb468ef4829c8129b3d718 /crypto/buffer/buffer.c
parentd02b48c63a58ea4367a0e905979f140b7d090f86 (diff)
Import of old SSLeay release: SSLeay 0.9.0b
Diffstat (limited to 'crypto/buffer/buffer.c')
-rw-r--r--crypto/buffer/buffer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/buffer/buffer.c b/crypto/buffer/buffer.c
index df7e2fad2b..7e8af9e2fa 100644
--- a/crypto/buffer/buffer.c
+++ b/crypto/buffer/buffer.c
@@ -1,5 +1,5 @@
/* crypto/buffer/buffer.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
@@ -94,7 +94,11 @@ int len;
char *ret;
unsigned int n;
- if (str->length >= len) return(len);
+ if (str->length >= len)
+ {
+ str->length=len;
+ return(len);
+ }
if (str->max >= len)
{
memset(&(str->data[str->length]),0,len-str->length);
@@ -126,6 +130,8 @@ char *str;
char *ret;
int n;
+ if (str == NULL) return(NULL);
+
n=strlen(str);
ret=Malloc(n+1);
if (ret == NULL)