summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/store_mem.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-15 09:10:30 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-15 11:15:05 +0200
commit255e3e18e00f717d99f3bc57c8a8895ff624f3c3 (patch)
treea2933c88f38e8dd7fe612be8dd458d05918b1f15 /source4/heimdal/lib/krb5/store_mem.c
parent70da27838bb3f6ed9c36add06ce0ccdf467ab1c3 (diff)
downloadsamba-255e3e18e00f717d99f3bc57c8a8895ff624f3c3.tar.gz
samba-255e3e18e00f717d99f3bc57c8a8895ff624f3c3.tar.bz2
samba-255e3e18e00f717d99f3bc57c8a8895ff624f3c3.zip
s4:heimdal: import lorikeet-heimdal-201107150856 (commit 48936803fae4a2fb362c79365d31f420c917b85b)
Diffstat (limited to 'source4/heimdal/lib/krb5/store_mem.c')
-rw-r--r--source4/heimdal/lib/krb5/store_mem.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/heimdal/lib/krb5/store_mem.c b/source4/heimdal/lib/krb5/store_mem.c
index b79bc19155..e674a95dba 100644
--- a/source4/heimdal/lib/krb5/store_mem.c
+++ b/source4/heimdal/lib/krb5/store_mem.c
@@ -44,7 +44,7 @@ static ssize_t
mem_fetch(krb5_storage *sp, void *data, size_t size)
{
mem_storage *s = (mem_storage*)sp->data;
- if(size > s->base + s->size - s->ptr)
+ if(size > (size_t)(s->base + s->size - s->ptr))
size = s->base + s->size - s->ptr;
memmove(data, s->ptr, size);
sp->seek(sp, size, SEEK_CUR);
@@ -55,7 +55,7 @@ static ssize_t
mem_store(krb5_storage *sp, const void *data, size_t size)
{
mem_storage *s = (mem_storage*)sp->data;
- if(size > s->base + s->size - s->ptr)
+ if(size > (size_t)(s->base + s->size - s->ptr))
size = s->base + s->size - s->ptr;
memmove(s->ptr, data, size);
sp->seek(sp, size, SEEK_CUR);
@@ -74,7 +74,7 @@ mem_seek(krb5_storage *sp, off_t offset, int whence)
mem_storage *s = (mem_storage*)sp->data;
switch(whence){
case SEEK_SET:
- if(offset > s->size)
+ if((size_t)offset > s->size)
offset = s->size;
if(offset < 0)
offset = 0;
@@ -95,7 +95,7 @@ static int
mem_trunc(krb5_storage *sp, off_t offset)
{
mem_storage *s = (mem_storage*)sp->data;
- if(offset > s->size)
+ if((size_t)offset > s->size)
return ERANGE;
s->size = offset;
if ((s->ptr - s->base) > offset)
@@ -145,6 +145,7 @@ krb5_storage_from_mem(void *buf, size_t len)
sp->seek = mem_seek;
sp->trunc = mem_trunc;
sp->free = NULL;
+ sp->max_alloc = UINT_MAX/8;
return sp;
}
@@ -203,5 +204,6 @@ krb5_storage_from_readonly_mem(const void *buf, size_t len)
sp->seek = mem_seek;
sp->trunc = mem_no_trunc;
sp->free = NULL;
+ sp->max_alloc = UINT_MAX/8;
return sp;
}