diff options
-rw-r--r-- | plugins/check_cluster.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/check_cluster.c b/plugins/check_cluster.c index b86e501..e1ede9f 100644 --- a/plugins/check_cluster.c +++ b/plugins/check_cluster.c | |||
@@ -143,6 +143,7 @@ int main(int argc, char **argv){ | |||
143 | 143 | ||
144 | int process_arguments(int argc, char **argv){ | 144 | int process_arguments(int argc, char **argv){ |
145 | int c; | 145 | int c; |
146 | char *ptr; | ||
146 | int option=0; | 147 | int option=0; |
147 | static struct option longopts[]={ | 148 | static struct option longopts[]={ |
148 | {"data", required_argument,0,'d'}, | 149 | {"data", required_argument,0,'d'}, |
@@ -188,6 +189,15 @@ int process_arguments(int argc, char **argv){ | |||
188 | 189 | ||
189 | case 'd': /* data values */ | 190 | case 'd': /* data values */ |
190 | data_vals=(char *)strdup(optarg); | 191 | data_vals=(char *)strdup(optarg); |
192 | /* validate data */ | ||
193 | for (ptr=data_vals;ptr!=NULL;ptr+=2){ | ||
194 | if (ptr[0]<'0' || ptr[0]>'3') | ||
195 | return ERROR; | ||
196 | if (ptr[1]=='\0') | ||
197 | break; | ||
198 | if (ptr[1]!=',') | ||
199 | return ERROR; | ||
200 | } | ||
191 | break; | 201 | break; |
192 | 202 | ||
193 | case 'l': /* text label */ | 203 | case 'l': /* text label */ |