X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fbuffer%2Fbuffer.c;fp=crypto%2Fbuffer%2Fbuffer.c;h=7e8af9e2fa367d11f56c2c82eadade457e30f2c3;hp=df7e2fad2b6e1405078c18ac5d789506ede38837;hb=58964a492275ca9a59a0cd9c8155cb2491b4b909;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86 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)