From b8c8cec26b4d7bed7fdf314d5a360fbd17af7d98 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 2 Jun 2020 09:02:45 +0200 Subject: [PATCH] fix bug introduced in c3d71b97abf943eb3c4937cb50db549e6ad74f05 see #459 --- miniupnpd/netfilter_nft/nftnlrdr_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miniupnpd/netfilter_nft/nftnlrdr_misc.c b/miniupnpd/netfilter_nft/nftnlrdr_misc.c index 0a59a42..1cf53d6 100644 --- a/miniupnpd/netfilter_nft/nftnlrdr_misc.c +++ b/miniupnpd/netfilter_nft/nftnlrdr_misc.c @@ -519,7 +519,7 @@ table_cb(const struct nlmsghdr *nlh, void *data) r->desc = malloc(r->desc_len + 1); if (r->desc != NULL) { memcpy(r->desc, descr, r->desc_len); - r->desc[r->desc_len + 1] = '\0'; + r->desc[r->desc_len] = '\0'; } else { syslog(LOG_ERR, "failed to allocate %u bytes for desc", r->desc_len); }