]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
transfer: remove k->str NULL check
authorDaniel Stenberg <daniel@haxx.se>
Mon, 1 Jun 2020 07:34:36 +0000 (09:34 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 1 Jun 2020 13:22:36 +0000 (15:22 +0200)
"Null-checking k->str suggests that it may be null, but it has already
been dereferenced on all paths leading to the check" - and it can't
legally be NULL at this point. Remove check.

Detected by Coverity CID 1463884

Closes #5495

lib/transfer.c

index ea337ea1daf9fb0d2ebad282f23f6aac56fe0b09..319744985bb9aca09921ea79e0e9c67be4f8850b 100644 (file)
@@ -688,7 +688,7 @@ static CURLcode readwrite_data(struct Curl_easy *data,
     /* This is not an 'else if' since it may be a rest from the header
        parsing, where the beginning of the buffer is headers and the end
        is non-headers. */
-    if(k->str && !k->header && (nread > 0 || is_empty_data)) {
+    if(!k->header && (nread > 0 || is_empty_data)) {
 
       if(data->set.opt_no_body) {
         /* data arrives although we want none, bail out */