Skip to content
Snippets Groups Projects
Commit 3d57907a authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Fixed a bug in text dump.

- Was causing errors when string was 1 byte long.
parent d2b1ebb1
No related branches found
No related tags found
No related merge requests found
......@@ -387,7 +387,7 @@ static char *rdata_txt_data_to_string(const uint8_t *data)
char *rdata_text_to_string(knot_rdata_item_t item)
{
uint16_t size = item.raw_data[0];
char *ret = malloc(sizeof(char) * size * 2) ;
char *ret = malloc(sizeof(char) * size * 2 + 1) ;
if (ret == NULL) {
ERR_ALLOC_FAILED;
return NULL;
......
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