]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
c-hyper: Remove superfluous pointer check
authorkokke <spam@rowdy.dk>
Fri, 5 Mar 2021 21:18:31 +0000 (22:18 +0100)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 5 Mar 2021 22:09:10 +0000 (17:09 -0500)
`n` pointer is never NULL once set. Found by static analysis.

Ref: https://github.com/curl/curl/issues/6696

Closes https://github.com/curl/curl/pull/6697

lib/c-hyper.c

index 8b4abd37f856104e7e2fa78b42cda16cc6565516..c3a16cf82f7e63d56f311fef426ad40ef701e2c5 100644 (file)
@@ -464,8 +464,6 @@ CURLcode Curl_hyper_header(struct Curl_easy *data, hyper_headers *headers,
     else
       linelen = 2; /* CRLF ending */
     linelen += (p - n);
-    if(!n)
-      return CURLE_BAD_FUNCTION_ARGUMENT;
     vlen = p - v;
 
     if(HYPERE_OK != hyper_headers_add(headers, (uint8_t *)n, nlen,