/*
* firewall3 - 3rd OpenWrt UCI firewall implementation
*
- * Copyright (C) 2013 Jo-Philipp Wich <jow@openwrt.org>
+ * Copyright (C) 2013 Jo-Philipp Wich <jo@mein.io>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
static inline void
fw3_xt_set_match_name(struct xtables_match *m)
{
- if (m->real_name)
- strcpy(m->m->u.user.name, m->real_name);
- else
- strcpy(m->m->u.user.name, m->name);
+ snprintf(m->m->u.user.name, sizeof(m->m->u.user.name), "%s",
+ m->real_name ? m->real_name : m->name);
}
static inline bool
static inline void
fw3_xt_set_target_name(struct xtables_target *t, const char *name)
{
- if (t->real_name)
- strcpy(t->t->u.user.name, t->real_name);
- else
- strcpy(t->t->u.user.name, name);
+ snprintf(t->t->u.user.name, sizeof(t->t->u.user.name), "%s",
+ t->real_name ? t->real_name : name);
}
static inline bool