summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2012-02-29 08:09:35 +0100
committerJan Engelhardt <jengelh@medozas.de>2012-02-29 08:11:00 +0100
commita250aaf6db151c812d06f2af380261935fa59b60 (patch)
tree7882ce945ea5ace5dedf9de3a184711f1616c9b6
parent6a56d048846547a5d5f5afded654f965b156c9b4 (diff)
Properly NUL-terminate name in nfct_timeout_attr_set
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--src/libnetfilter_cttimeout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c
index 707543a..1f7c63e 100644
--- a/src/libnetfilter_cttimeout.c
+++ b/src/libnetfilter_cttimeout.c
@@ -177,7 +177,8 @@ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
{
switch(type) {
case NFCT_TIMEOUT_ATTR_NAME:
- strncpy(t->name, data, 32);
+ strncpy(t->name, data, sizeof(t->name));
+ t->name[sizeof(t->name)-1] = '\0';
break;
case NFCT_TIMEOUT_ATTR_L3PROTO:
t->l3num = *((uint16_t *) data);