[master] 778dbd1 VSB_quote() is getting too complex, I'll need to revisit that...

Poul-Henning Kamp phk at FreeBSD.org
Fri Feb 3 10:45:06 CET 2017


commit 778dbd1db17ee589dc3b45c5f03eef194dfc120f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Feb 3 09:06:12 2017 +0000

    VSB_quote() is getting too complex, I'll need to revisit that...

diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c
index 2f32acb..d950608 100644
--- a/lib/libvarnish/vsb.c
+++ b/lib/libvarnish/vsb.c
@@ -544,7 +544,8 @@ VSB_quote_pfx(struct vsb *s, const char *pfx, const void *v, int len, int how)
 	}
 	if (!quote && !(how & (VSB_QUOTE_JSON|VSB_QUOTE_CSTR))) {
 		(void)VSB_bcat(s, p, len);
-		if ((how & VSB_QUOTE_NONL) && p[len-1] != '\n')
+		if ((how & (VSB_QUOTE_UNSAFE|VSB_QUOTE_NONL))
+		    && p[len-1] != '\n')
 			(void)VSB_putc(s, '\n');
 		return;
 	}



More information about the varnish-commit mailing list