]> granicus.if.org Git - curl/commitdiff
curl: fix potential NULL dereference
authorDaniel Stenberg <daniel@haxx.se>
Fri, 22 May 2015 14:18:36 +0000 (16:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 May 2015 14:19:30 +0000 (16:19 +0200)
Coverity CID 1299428: Dereference after null check (FORWARD_NULL)

src/tool_operate.c

index 5f7b792118fa9991e999b67ed1d8c62da63b9351..4c3ed077b18abd9cd3cecece4e2143c56699d6c1 100644 (file)
@@ -1497,7 +1497,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
                 if(retry_sleep > RETRY_SLEEP_MAX)
                   retry_sleep = RETRY_SLEEP_MAX;
               }
-              if(outs.bytes && outs.filename) {
+              if(outs.bytes && outs.filename && outs.stream) {
                 /* We have written data to a output file, we truncate file
                  */
                 if(!global->mute)