cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: [PATCH] Fix segfault if --libcurl output file cannot be created.

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Mon, 2 Feb 2015 19:16:52 +0000

On Mon, 2 Feb 2015, Paul Broadhead wrote:

> If the outfile for the --libcurl option cannot be created, curl seg faults:
>
> curl http://www.google.com --libcurl test/c
>
> Please find a very simple patch attached.

Thank you for your patch Paul - however, I would be interested to know why config->current causes a segfault and why changing it to config->last fixes it.

I'm running under Windows but if I perform the following all is okay:

curl http://www.google.com --libcurl d:\test

Note: d:\ is my DVD drive so isn't writable but I also tried a folder that doesn't exist as well.

Also note: That "last" will not be the current configuration in a multi-config operations when --next is used however I think warnf() only uses global config variables now so I will investigate changing that function.

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-02-02