From: Harald Welte Date: Thu, 14 Feb 2002 23:47:54 +0000 (+0000) Subject: fix for psd-delay-threshold > 100 X-Git-Tag: v1.2.6~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63c364d6fd20b1f58df9e91bcb4cfea2ebae6507;p=thirdparty%2Fiptables.git fix for psd-delay-threshold > 100 --- diff --git a/extensions/libipt_psd.c b/extensions/libipt_psd.c index 0b8b4870..de1fc76c 100644 --- a/extensions/libipt_psd.c +++ b/extensions/libipt_psd.c @@ -82,12 +82,11 @@ parse(int c, char **argv, int invert, unsigned int *flags, { struct ipt_psd_info *psdinfo = (struct ipt_psd_info *)(*match)->data; unsigned int num; - char storage[sizeof(optarg) + 1]; + char storage[strlen(optarg) + 2]; - /* string_to_number needs this */ + /* string_to_number needs a leading space */ storage[0] = ' '; - strncpy(&storage[1], optarg, (size_t) sizeof(optarg)); - storage[sizeof(optarg)] = 0; + strcpy(&storage[1], optarg); switch (c) { /* PSD-weight-threshold */