[master] 621c408ae Move boc check before boc->state is dereferenced
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Tue Sep 4 06:48:07 UTC 2018
commit 621c408ae36ceceae0314a3df8f8ec3c51297bff
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Tue Sep 4 08:44:52 2018 +0200
Move boc check before boc->state is dereferenced
Refs 9804794a0e876800e4e3ca10e965b568bd37c38e
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index a87462646..182a7a97d 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -406,11 +406,8 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
if (oc->flags & OC_F_FAILED)
continue;
+ CHECK_OBJ_ORNULL(oc->boc, BOC_MAGIC);
if (oc->boc != NULL && oc->boc->state < BOS_STREAM) {
- // XXX does it make sense to have the CHECK_OBJ
- // if we access boc->state before it?
- CHECK_OBJ_ORNULL(oc->boc, BOC_MAGIC);
-
if (req->hash_ignore_busy)
continue;
More information about the varnish-commit
mailing list