aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 00:26:31 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-08 00:26:31 +0100
commitee75d8e3e559e4424113c9c1fbc2275a545fc887 (patch)
tree673296900fb5faf77b95d7f11cf6baa0cc68fec2
parent0954abcf098efbf2c73373a49c7fe26a5effcfcb (diff)
downloadslcl-ee75d8e3e559e4424113c9c1fbc2275a545fc887.tar.gz
html.c: Allow empty strings on html_encode
-rw-r--r--html.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/html.c b/html.c
index 95d26b9..cad966b 100644
--- a/html.c
+++ b/html.c
@@ -24,6 +24,12 @@ static char *html_encode(const char *s)
dynstr_init(&d);
+ if (!*s && dynstr_append(&d, ""))
+ {
+ fprintf(stderr, "%s: dynstr_append empty failed\n", __func__);
+ goto failure;
+ }
+
while (*s)
{
static const struct esc