projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Import of old SSLeay release: SSLeay 0.9.0b
[openssl.git]
/
crypto
/
buffer
/
buffer.c
diff --git
a/crypto/buffer/buffer.c
b/crypto/buffer/buffer.c
index df7e2fad2b6e1405078c18ac5d789506ede38837..7e8af9e2fa367d11f56c2c82eadade457e30f2c3 100644
(file)
--- a/
crypto/buffer/buffer.c
+++ b/
crypto/buffer/buffer.c
@@
-1,5
+1,5
@@
/* crypto/buffer/buffer.c */
/* crypto/buffer/buffer.c */
-/* Copyright (C) 1995-199
7
Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-199
8
Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* All rights reserved.
*
* This package is an SSL implementation written
@@
-94,7
+94,11
@@
int len;
char *ret;
unsigned int n;
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);
if (str->max >= len)
{
memset(&(str->data[str->length]),0,len-str->length);
@@
-126,6
+130,8
@@
char *str;
char *ret;
int n;
char *ret;
int n;
+ if (str == NULL) return(NULL);
+
n=strlen(str);
ret=Malloc(n+1);
if (ret == NULL)
n=strlen(str);
ret=Malloc(n+1);
if (ret == NULL)