diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-03-22 16:13:15 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-03-27 09:10:34 +0200 |
commit | 817ab8a8d428fe4854625ee0a804701449951833 (patch) | |
tree | e84d2c51f1b3986a69ca04e9c00a779b7c0fcf57 /src/libcharon/encoding/parser.c | |
parent | adfd3b992fc4effb81f8ce9268d66117e8c32557 (diff) | |
download | strongswan-817ab8a8d428fe4854625ee0a804701449951833.tar.bz2 strongswan-817ab8a8d428fe4854625ee0a804701449951833.tar.xz |
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.
Diffstat (limited to 'src/libcharon/encoding/parser.c')
-rw-r--r-- | src/libcharon/encoding/parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcharon/encoding/parser.c b/src/libcharon/encoding/parser.c index 6309a5c3f..e49210309 100644 --- a/src/libcharon/encoding/parser.c +++ b/src/libcharon/encoding/parser.c @@ -377,7 +377,7 @@ METHOD(parser_t, parse_payload, status_t, payload_type_names, payload_type, this->input_roof - this->byte_pos); DBG3(DBG_ENC, "parsing payload from %b", - this->byte_pos, this->input_roof - this->byte_pos); + this->byte_pos, (u_int)(this->input_roof - this->byte_pos)); /* base pointer for output, avoids casting in every rule */ output = pld; |