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.
This commit is contained in:
@@ -235,7 +235,7 @@ static packet_t *receive_packet(private_socket_dynamic_socket_t *this,
|
||||
DBG1(DBG_NET, "receive buffer too small, packet discarded");
|
||||
return NULL;
|
||||
}
|
||||
DBG3(DBG_NET, "received packet %b", buffer, len);
|
||||
DBG3(DBG_NET, "received packet %b", buffer, (u_int)len);
|
||||
|
||||
if (len < MARKER_LEN)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user