Commit a8baf411 authored by Daniel Salzman's avatar Daniel Salzman

libknot: better assert in knot_rdata_init

parent efb894a4
......@@ -51,9 +51,11 @@ typedef struct {
inline static void knot_rdata_init(knot_rdata_t *rdata, uint16_t len, const uint8_t *data)
{
assert(rdata);
assert(data);
rdata->len = len;
memcpy(rdata->data, data, len);
if (rdata->len > 0) {
assert(data);
memcpy(rdata->data, data, len);
}
}
/*!
......
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