Skip to content

Use dns_name_copy() to hold the copied name

In tkey.c, dns_name_clone() was being used to copy the source name into dns_fixedname_t structure. However the dns_name_clone() just makes the target->ndata = source->ndata and when source->ndata is gone, so is target->ndata.

The function that needs to be used here is dns_name_copynf() that copies the source->ndata to target->ndata buffer.

As a side note - no memory was lost, because the ndata buffer used in the dns_fixedname_t is internal to the structure and freed when the dns_fixedname_t is freed regardless of the .ndata contents.

Closes #2713 (closed)

Edited by Evan Hunt

Merge request reports