summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/store_emem.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/store_emem.c')
-rw-r--r--crypto/heimdal/lib/krb5/store_emem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/heimdal/lib/krb5/store_emem.c b/crypto/heimdal/lib/krb5/store_emem.c
index 337a81c..47ca1c8 100644
--- a/crypto/heimdal/lib/krb5/store_emem.c
+++ b/crypto/heimdal/lib/krb5/store_emem.c
@@ -34,7 +34,7 @@
#include "krb5_locl.h"
#include "store-int.h"
-RCSID("$Id: store_emem.c,v 1.12 2002/04/18 14:00:34 joda Exp $");
+RCSID("$Id: store_emem.c,v 1.12.4.1 2002/10/21 16:08:55 joda Exp $");
typedef struct emem_storage{
unsigned char *base;
@@ -61,8 +61,10 @@ emem_store(krb5_storage *sp, const void *data, size_t size)
if(size > s->base + s->size - s->ptr){
void *base;
size_t sz, off;
- sz = 2 * (size + (s->ptr - s->base)); /* XXX */
off = s->ptr - s->base;
+ sz = off + size;
+ if (sz < 4096)
+ sz *= 2;
base = realloc(s->base, sz);
if(base == NULL)
return 0;
OpenPOWER on IntegriCloud