use dup'ed string in fw3_parse_monthdays()
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 28 Feb 2013 13:07:22 +0000 (14:07 +0100)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 28 Feb 2013 13:07:42 +0000 (14:07 +0100)
options.c

index ff9a9643acd9aead48f9b54be92eb05f8f888e39..a35247f331faa374fc1c595e34227f43173e54fc 100644 (file)
--- a/options.c
+++ b/options.c
@@ -636,7 +636,7 @@ fw3_parse_monthdays(void *ptr, const char *val)
        if (!(s = strdup(val)))
                return false;
 
-       for (p = strtok((char *)val, " \t"); p; p = strtok(NULL, " \t"))
+       for (p = strtok(s, " \t"); p; p = strtok(NULL, " \t"))
        {
                d = strtoul(p, &p, 10);