g_assert(p);
g_assert(b);
g_assert(l);
-
+
if (!(d = flx_dns_packet_extend(p, l)))
return NULL;
}
default:
- if (!(data = flx_dns_packet_get_rptr(p)) ||
- flx_dns_packet_skip(p, rdlength) < 0)
- return NULL;
+
+ if (rdlength > 0) {
+
+ if (!(data = flx_dns_packet_get_rptr(p)) ||
+ flx_dns_packet_skip(p, rdlength) < 0)
+ return NULL;
+ } else
+ data = NULL;
break;
}
default:
if (!flx_dns_packet_append_uint16(p, r->size) ||
- !flx_dns_packet_append_bytes(p, r->data, r->size))
+ (r->size != 0 && !flx_dns_packet_append_bytes(p, r->data, r->size)))
return NULL;
}