mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-15 00:54:57 +02:00
condition: rework condvar name check
Use memchr() instead of a for loop to detect '/' in the condvar name. Also unconditionally disallow names starting with a dot.
This commit is contained in:
@@ -31,8 +31,8 @@ static int condition_parse(int c, char **argv, int invert, unsigned int *flags,
|
||||
|
||||
check_inverse(optarg, &invert, &optind, 0);
|
||||
|
||||
if (strlen(argv[optind - 1]) < CONDITION_NAME_LEN)
|
||||
strcpy(info->name, argv[optind - 1]);
|
||||
if (strlen(optarg) < sizeof(info->name))
|
||||
strcpy(info->name, optarg);
|
||||
else
|
||||
exit_error(PARAMETER_PROBLEM,
|
||||
"File name too long");
|
||||
|
Reference in New Issue
Block a user