From c86132442bc8885b310af888bfdb9935baae3009 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 28 May 2026 22:00:09 +0000 Subject: [PATCH] Don't treat quoted empty string as NULL --- ncat/http.c | 2 +- ncat/sys_wrap.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ncat/http.c b/ncat/http.c index 0788ec253..16bfe32df 100644 --- a/ncat/http.c +++ b/ncat/http.c @@ -642,7 +642,7 @@ static const char *read_quoted_string(const char *s, char **quoted_string) } s++; - *quoted_string = buf; + *quoted_string = buf ? buf : Strdup(""); return s; } diff --git a/ncat/sys_wrap.c b/ncat/sys_wrap.c index 934d7d736..0151d7d91 100644 --- a/ncat/sys_wrap.c +++ b/ncat/sys_wrap.c @@ -173,6 +173,8 @@ char *Strdup(const char *s) { char *ret; + if (s == NULL) + bye("Strdup argument must not be NULL"); ret = strdup(s); if (ret == NULL) die("strdup");