Commit 398d7c6e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Ensure that we never call a VDP with a zero length unless we are done.

Fixes #1561
parent 60020658
......@@ -833,6 +833,7 @@ VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
assert(act > VDP_NULL || len > 0);
/* Call the present layer, while pointing to the next layer down */
i = req->vdp_nxt--;
assert(i >= 0 && i < N_VDPS);
......
......@@ -77,9 +77,12 @@ ObjIter(struct objiter *oi, void **p, ssize_t *l)
oi->st = VTAILQ_FIRST(&oi->obj->body->list);
else
oi->st = VTAILQ_NEXT(oi->st, list);
while(oi->st != NULL && oi->st->len == 0)
oi->st = VTAILQ_NEXT(oi->st, list);
if (oi->st != NULL) {
*p = oi->st->ptr;
*l = oi->st->len;
assert(*l > 0);
return (OIS_DATA);
}
return (OIS_DONE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment