]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
fix for psd-delay-threshold > 100
authorHarald Welte <laforge@gnumonks.org>
Thu, 14 Feb 2002 23:47:54 +0000 (23:47 +0000)
committerHarald Welte <laforge@gnumonks.org>
Thu, 14 Feb 2002 23:47:54 +0000 (23:47 +0000)
extensions/libipt_psd.c

index 0b8b4870d4ed97475b97009ed83555a5f31df8b3..de1fc76c465da57a1f52ed268192f6e669ed3118 100644 (file)
@@ -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 */