[master] 0124731 Dont eat newlines in VSB_QUOTE_CSTR mode

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 10 18:41:04 CEST 2016


commit 01247317a3aa09967d243d47ef3a7a4511ec4669
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 10 16:39:43 2016 +0000

    Dont eat newlines in VSB_QUOTE_CSTR mode
    
    Spotted by:	gquintar

diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c
index 6a6f169..23fa142 100644
--- a/lib/libvarnish/vsb.c
+++ b/lib/libvarnish/vsb.c
@@ -555,7 +555,7 @@ VSB_quote(struct vsb *s, const void *v, int len, int how)
 			break;
 		case '\n':
 			if (how & VSB_QUOTE_CSTR)
-				(void)VSB_cat(s, "\"\n\t\"");
+				(void)VSB_cat(s, "\\n\"\n\t\"");
 			else if (how & VSB_QUOTE_NONL)
 				(void)VSB_cat(s, "\n");
 			else



More information about the varnish-commit mailing list