Skip to content
Snippets Groups Projects
Commit 39194f3b authored by Daniel Salzman's avatar Daniel Salzman
Browse files

libknot: fix UBSAN warning 'applying zero offset to null pointer'

parent ab74fdf0
No related branches found
No related tags found
No related merge requests found
Pipeline #128036 passed
/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2024 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -286,7 +286,7 @@ static inline const knot_rrset_t *knot_pkt_rr(const knot_pktsection_t *section,
uint16_t i)
{
assert(section);
return section->pkt->rr + section->pos + i;
return (void *)((uintptr_t)section->pkt->rr + section->pos + i);
}
/*! \brief Get RRSet offset in the packet wire. */
......
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