[master] 35475f8 Missing errorchecks incompilation of regsub()

Poul-Henning Kamp phk at varnish-cache.org
Mon Apr 16 09:12:31 CEST 2012


commit 35475f8c5db39fa47a0d5862f00737ccd9985575
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Apr 16 07:12:10 2012 +0000

    Missing errorchecks incompilation of regsub()
    
    Fixes #1125

diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
index 203d76f..30e63d9 100644
--- a/lib/libvcl/vcc_expr.c
+++ b/lib/libvcl/vcc_expr.c
@@ -454,6 +454,8 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym)
 	SkipToken(tl, '(');
 
 	vcc_expr0(tl, &e2, STRING);
+	if (e2 == NULL)
+		return;
 	if (e2->fmt != STRING)
 		vcc_expr_tostring(&e2, STRING);
 
@@ -467,6 +469,8 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym)
 
 	SkipToken(tl, ',');
 	vcc_expr0(tl, &e2, STRING);
+	if (e2 == NULL)
+		return;
 	if (e2->fmt != STRING)
 		vcc_expr_tostring(&e2, STRING);
 	*e = vcc_expr_edit(STRING, "\v1, \v2)", *e, e2);



More information about the varnish-commit mailing list