Commit c611b9a6 authored by Reza Naghibi's avatar Reza Naghibi Committed by Poul-Henning Kamp

Guard against OA_GZIPBITS streaming race

parent cfe0beee
......@@ -292,6 +292,10 @@ vdp_gunzip_init(struct req *req, void **priv)
ssize_t dl;
uint64_t u;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
CHECK_OBJ_ORNULL(req->objcore->boc, BOC_MAGIC);
vg = VGZ_NewGunzip(req->vsl, "U D -");
AN(vg);
if (vgz_getmbuf(vg)) {
......@@ -306,6 +310,10 @@ vdp_gunzip_init(struct req *req, void **priv)
req->resp_len = -1;
/* OA_GZIPBITS is not stable yet */
if (req->objcore->boc)
return (0);
p = ObjGetAttr(req->wrk, req->objcore, OA_GZIPBITS, &dl);
if (p != NULL && dl == 32) {
u = vbe64dec(p + 24);
......
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