Re: [patch] Fix inconsistency between curl_write_callback and tool_header_cb/tool_write_cb
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:
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
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
- text/x-patch attachment: curl-tool_debug_cb-fix-function-definition-cfi.patch