Skip to content
Snippets Groups Projects
Commit 29a045d7 authored by Jan Doskočil's avatar Jan Doskočil Committed by Daniel Salzman
Browse files

libknot-xdp: remove pointer arithmetics on NULL

Realistically this is not an issue, but UBSAN complained.
parent 34652e04
No related branches found
No related tags found
1 merge request!1682Pointer arithmetics on NULL are UB - remedied by a cast to uintptr_t
Pipeline #127668 passed
......@@ -545,7 +545,7 @@ int knot_xdp_recv(knot_xdp_socket_t *socket, knot_xdp_msg_t msgs[],
static uint8_t *msg_uframe_ptr(const knot_xdp_msg_t *msg)
{
return NULL + ((msg->payload.iov_base - NULL) & ~(FRAME_SIZE - 1));
return (uint8_t *)((uintptr_t)msg->payload.iov_base & ~(FRAME_SIZE - 1));
}
_public_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment