mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 08:45:26 -05:00
netfilter: xtables: Use strscpy() instead of strscpy_pad()
kzalloc() already zero-initializes the destination buffer, making strscpy() sufficient for safely copying the name. The additional NUL- padding performed by strscpy_pad() is unnecessary. The size parameter is optional, and strscpy() automatically determines the size of the destination buffer using sizeof() if the argument is omitted. This makes the explicit sizeof() call unnecessary; remove it. No functional changes intended. Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
committed by
Pablo Neira Ayuso
parent
778b09d91b
commit
3b4aff61ca
@@ -29,7 +29,7 @@
|
||||
if (tbl == NULL) \
|
||||
return NULL; \
|
||||
term = (struct type##_error *)&(((char *)tbl)[term_offset]); \
|
||||
strscpy_pad(tbl->repl.name, info->name, sizeof(tbl->repl.name)); \
|
||||
strscpy(tbl->repl.name, info->name); \
|
||||
*term = (struct type##_error)typ2##_ERROR_INIT; \
|
||||
tbl->repl.valid_hooks = hook_mask; \
|
||||
tbl->repl.num_entries = nhooks + 1; \
|
||||
|
||||
Reference in New Issue
Block a user