update to iptables-1.3.8
[iptables.git] / extensions / libipt_ULOG.c
index f4b7a14..a73b685 100644 (file)
@@ -110,6 +110,14 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
                                   "Maximum prefix length %u for --ulog-prefix",
                                   (unsigned int)sizeof(loginfo->prefix) - 1);
 
+               if (strlen(optarg) == 0)
+                       exit_error(PARAMETER_PROBLEM,
+                                  "No prefix specified for --ulog-prefix");
+
+               if (strlen(optarg) != strlen(strtok(optarg, "\n")))
+                       exit_error(PARAMETER_PROBLEM,
+                                  "Newlines not allowed in --ulog-prefix");
+
                strcpy(loginfo->prefix, optarg);
                *flags |= IPT_LOG_OPT_PREFIX;
                break;