make sure emem_trunc doesnt point past end

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24230 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2009-01-11 21:40:23 +00:00
parent 0e46e8afa2
commit 056fc8cf87

View File

@@ -123,6 +123,8 @@ emem_trunc(krb5_storage *sp, off_t offset)
s->base = base;
}
s->len = offset;
if ((s->ptr - s->base) > offset)
s->ptr = s->base + offset;
return 0;
}