]> git.ipfire.org Git - people/ms/strongswan.git/commit - src/libstrongswan/utils/utils.c
Don't cast second argument of mem_printf_hook (%b) to size_t.
authorTobias Brunner <tobias@strongswan.org>
Thu, 22 Mar 2012 15:13:15 +0000 (16:13 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 27 Mar 2012 07:10:34 +0000 (09:10 +0200)
commit817ab8a8d428fe4854625ee0a804701449951833
treee84d2c51f1b3986a69ca04e9c00a779b7c0fcf57
parentadfd3b992fc4effb81f8ce9268d66117e8c32557
Don't cast second argument of mem_printf_hook (%b) to size_t.

Also treat the given number as unsigned int.

Due to the printf hook registration the second argument of
mem_printf_hook (if called via printf etc.) is always of type int*.
Casting this to a size_t pointer and then dereferencing that as int does
not work on big endian machines if int is smaller than size_t (e.g. on ppc64).

In order to make this change work if the argument is of a type larger
than int, size_t for instance, the second argument for %b has to be casted
to (u_)int.
src/libcharon/encoding/generator.c
src/libcharon/encoding/parser.c
src/libcharon/plugins/eap_sim_pcsc/eap_sim_pcsc_card.c
src/libcharon/plugins/smp/smp.c
src/libcharon/plugins/socket_dynamic/socket_dynamic_socket.c
src/libstrongswan/chunk.c
src/libstrongswan/plugins/fips_prf/fips_prf.c
src/libstrongswan/utils.c
src/libstrongswan/utils.h