curl / Mailing Lists / curl-library / Single Mail

curl-library

Null pointer dereference in tool_write_cb?

From: Jakub Wilk <jwilk_at_jwilk.net>
Date: Sat, 17 Jun 2017 23:40:56 +0200

Since 5385450afd61, the tool_write_cb() function contains the following code
(with boring parts snipped):

  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.

This was noticed by Hacker News user "Someone":
https://news.ycombinator.com/item?id=14574906#14577585

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