Commit c36c439f authored by Daniel Salzman's avatar Daniel Salzman
Browse files

kdig: fix misaligned address load when printing EDE

parent ffaaebce
......@@ -250,7 +250,9 @@ static void print_ede(const uint8_t *data, uint16_t len)
printf("(malformed)");
return;
}
uint16_t errcode = be16toh(*(uint16_t *)data);
uint16_t errcode;
memcpy(&errcode, data, sizeof(errcode));
errcode = be16toh(errcode);
const char *strerr = knot_edns_ede_strerr(errcode);
if (len > 2) {
printf("%hu (%s): '%.*s'", errcode, strerr, (int)(len - 2), data + 2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment