Resolve pointers in capn_getv*

Reported by @xvuko, fixes #20
This commit is contained in:
David Lamparter 2017-05-19 09:05:47 +02:00
parent 7c819065e0
commit e0d1c36e43
2 changed files with 6 additions and 2 deletions

View file

@ -41,7 +41,9 @@ UINT_T CAT(capn_get,SZ) (LIST_T l, int off) {
int CAT(capn_getv,SZ) (LIST_T l, int off, UINT_T *to, int sz) {
int i;
capn_ptr p = l.p;
capn_ptr p;
capn_resolve(&l.p);
p = l.p;
if (off + sz > p.len) {
sz = p.len - off;
}