curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Null pointer dereference in tool_write_cb?

From: Daniel Stenberg <daniel_at_haxx.se>
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.

[*] =
https://daniel.haxx.se/blog/2017/06/17/curl-doesnt-spew-binary-anymore/comment-page-1/#comment-18356

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-06-17