fix bug introduced in c3d71b97abf943eb3c4937cb50db549e6ad74f05

see #459
This commit is contained in:
Thomas Bernard 2020-06-02 09:02:45 +02:00
parent fb63cf3455
commit b8c8cec26b
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -519,7 +519,7 @@ table_cb(const struct nlmsghdr *nlh, void *data)
r->desc = malloc(r->desc_len + 1); r->desc = malloc(r->desc_len + 1);
if (r->desc != NULL) { if (r->desc != NULL) {
memcpy(r->desc, descr, r->desc_len); memcpy(r->desc, descr, r->desc_len);
r->desc[r->desc_len + 1] = '\0'; r->desc[r->desc_len] = '\0';
} else { } else {
syslog(LOG_ERR, "failed to allocate %u bytes for desc", r->desc_len); syslog(LOG_ERR, "failed to allocate %u bytes for desc", r->desc_len);
} }