curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patch] Fix inconsistency between curl_write_callback and tool_header_cb/tool_write_cb

From: Hanno Böck <hanno_at_hboeck.de>
Date: Wed, 29 Mar 2017 13:59:01 +0200

On Wed, 29 Mar 2017 10:09:05 +0200 (CEST)
Daniel Stenberg <daniel_at_haxx.se> wrote:

> Thanks Hanno, I agree completely with your patch. Now landed in git:
> https://github.com/curl/curl/commit/aced311d18

Hi,

Thanks for applying.

Attached is another patch of similar kind. Several tests gave an error
with cfi like this:
 sendf.c:798:12: runtime error: control flow integrity check for type
'int (struct Curl_easy *, curl_infotype, char *, unsigned long, void
*)' failed during indirect function
call /mnt/ram/curl/src/tool_cb_dbg.c:46: note: tool_debug_cb defined
here

The function tool_debug_cb doesn't match curl_debug_callback in curl.h
(unsigned vs. signed char* for 3rd param).

This is a bit messier to fix, as the function dump, called by
curl_debug_callback, expects it to be unsigned, so we have to cast the
pointer somewhere. I'm doing this now at the call to dump(), however
one could argue whether it should be done at another point, e.g. right
at the beginning of tool_debug_cb().

With that patch applied I can run make check with no more CFI-related
errors showing up.

-- 
Hanno Böck
https://hboeck.de/
mail/jabber: hanno_at_hboeck.de
GPG: FE73757FA60E4E21B937579FA5880072BBB51E42


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

Received on 2017-03-29