NFT_RULE_USERDATA is sized, not null-terminated. Must use strndup()
This commit is contained in:
parent
b6303c8836
commit
b36a6e94f8
|
@ -597,7 +597,7 @@ table_cb(const struct nlmsghdr *nlh, void *data)
|
|||
descr = (char *) nftnl_rule_get_data(t, NFTNL_RULE_USERDATA,
|
||||
&r->desc_len);
|
||||
if (r->desc_len > 0)
|
||||
r->desc = strdup(descr);
|
||||
r->desc = strndup(descr, r->desc_len);
|
||||
|
||||
r->handle = *(uint32_t *) nftnl_rule_get_data(t,
|
||||
NFTNL_RULE_HANDLE,
|
||||
|
|
Loading…
Reference in New Issue