curl / Mailing Lists / curl-library / Single Mail


Re: Null pointer dereference in tool_write_cb?

From: Daniel Stenberg <>
Date: Sat, 17 Jun 2017 23:54:45 +0200 (CEST)

On Sat, 17 Jun 2017, Jakub Wilk wrote:

> bool isatty = config->global->isatty;
> /* ... */
> if(!config)
> return failure;
> Something if off here: either config can be NULL, and then the first line
> would deference such pointer; or config can never be NULL, and the null
> pointer check is superfluous.

Right, thank you. I saw that comment too - it was also posted as a comment[*]
to my blog post.

It made me take a closer look on the code and I cannot see how config can ever
be NULL there, as it should then have failed much much earlier.

I'll remove the check.

[*] =

Received on 2017-06-17