]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
strparse: split a multi-line assert into many separate ones
authorDaniel Stenberg <daniel@haxx.se>
Wed, 13 May 2026 21:28:43 +0000 (23:28 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 13 May 2026 21:47:39 +0000 (23:47 +0200)
This way we can better tell exactly which condition that triggers. Like
in fuzzer logs.

Closes #21599

lib/curlx/strparse.c

index 7866b2087ab782bb74814253d7be071955560137..3082a6740adcfffe59d6af02201820614ea9a40d 100644 (file)
@@ -49,9 +49,14 @@ void curlx_str_trim(struct Curl_str *out, size_t len)
 int curlx_str_until(const char **linep, struct Curl_str *out,
                     const size_t max, char delim)
 {
-  const char *s = *linep;
+  const char *s;
   size_t len = 0;
-  DEBUGASSERT(linep && *linep && out && max && delim);
+  DEBUGASSERT(linep);
+  DEBUGASSERT(*linep);
+  DEBUGASSERT(out);
+  DEBUGASSERT(max);
+  DEBUGASSERT(delim);
+  s = *linep;
 
   curlx_str_init(out);
   while(*s && (*s != delim)) {