From cc714d9006553f852f41954e2e9f55e7ee57accd Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Wed, 8 Mar 2023 00:26:31 +0100 Subject: html.c: Allow empty strings on html_encode --- html.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3