[master] f542cab Release memory instead of crashing on malformed ESI
PÃ¥l Hermunn Johansen
hermunn at varnish-software.com
Mon Apr 25 15:44:05 CEST 2016
commit f542cabbf977a09df89cf71c39ceda9c11d774ec
Author: Pål Hermunn Johansen <hermunn at varnish-software.com>
Date: Tue Apr 19 16:59:03 2016 +0200
Release memory instead of crashing on malformed ESI
When an ESI tag contains an unterminated quote or misses its ending
'>', we release the relevant buffers instead of crashing.
Fixes: #1904
diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index 815bac4..eac151e 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -1047,8 +1047,11 @@ VEP_Finish(struct vep_state *vep)
CHECK_OBJ_NOTNULL(vep, VEP_MAGIC);
- AZ(vep->include_src);
- AZ(vep->attr_vsb);
+ if (vep->include_src)
+ VSB_destroy(&vep->include_src);
+ if (vep->attr_vsb)
+ VSB_destroy(&vep->attr_vsb);
+
if (vep->o_pending)
vep_mark_common(vep, vep->ver_p, vep->last_mark);
if (vep->o_wait > 0) {
More information about the varnish-commit
mailing list