]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
operate: avoid NULL dereference
authorDaniel Stenberg <daniel@haxx.se>
Wed, 8 Oct 2014 11:18:55 +0000 (13:18 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 8 Oct 2014 11:18:55 +0000 (13:18 +0200)
Coverity CID 1241948. dumpeasysrc() would get called with
config->current set to NULL which could be dereferenced by a warnf()
call.

src/tool_operate.c

index 7448cad9cfd4d6233984e1b38d448ec830c3e427..fe54a34a7b6a41bfdac245f6c4155f54530b2151 100644 (file)
@@ -1848,6 +1848,9 @@ CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[])
         /* Cleanup the libcurl source output */
         easysrc_cleanup();
 
+        /* set current back to first so that isn't NULL */
+        config->current = config->first;
+
         /* Dump the libcurl code if previously enabled */
         dumpeasysrc(config);
 #endif