aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-10-08 13:18:55 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-08 13:18:55 +0200
commiteb1e3a398512381d470ee297920c863c8f379c08 (patch)
tree10b386c189b7dbca2cc3a41b3b9379e2ff4ac97d
parent87c8e00b7af8fa9b910e6455d673146925b7a9cb (diff)
operate: avoid NULL dereference
Coverity CID 1241948. dumpeasysrc() would get called with config->current set to NULL which could be dereferenced by a warnf() call.
-rw-r--r--src/tool_operate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 7448cad9c..fe54a34a7 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -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