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");