aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/buffer/buffer.c
diff options
context:
space:
mode:
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)