Skip to content
Snippets Groups Projects
Commit db583498 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

possible array negative index access in rr_already_signed()

CID: 1094068
parent b34c6820
No related branches found
No related tags found
No related merge requests found
......@@ -160,8 +160,8 @@ int knot_dname_to_lower(knot_dname_t *name);
*
* \param name Domain name to get the size of.
*
* \retval size of the domain name
* \retval KNOT_ERROR
* \retval sze of the domain name.
* \retval KNOT_EINVAL
*/
int knot_dname_size(const knot_dname_t *name);
......@@ -172,7 +172,7 @@ int knot_dname_size(const knot_dname_t *name);
* \param pkt Related packet (or NULL if unpacked)
*
* \retval size of the domain name
* \retval KNOT_ERROR
* \retval KNOT_EINVAL
*/
int knot_dname_realsize(const knot_dname_t *name, const uint8_t *pkt);
......
......@@ -406,9 +406,12 @@ static int resign_rrset(const knot_rrset_t *covered,
*/
static bool rr_already_signed(const knot_rrset_t *rrset, ahtable_t *t)
{
assert(rrset && t);
assert(rrset);
assert(t);
// Create a key = combination of owner and type mnemonic
int dname_size = knot_dname_size(rrset->owner);
assert(dname_size > 0);
char key[dname_size + 16];
memset(key, 0, sizeof(key));
memcpy(key, rrset->owner, dname_size);
......
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