From 6aa7a62ee09e5ddc6a4f16cf18c0eb71a1ccf582 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 25 Jul 2013 16:54:16 +0200 Subject: [PATCH] client: Check if optarg is different from NULL before dereferencing. CID 968159 --- client/csync_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/csync_client.c b/client/csync_client.c index 6f28f6e710..6bb40bbc5e 100644 --- a/client/csync_client.c +++ b/client/csync_client.c @@ -145,8 +145,10 @@ static int parse_args(struct argument_s *csync_args, int argc, char **argv) case 0: opt = (struct option*)&(long_options[c]); if(c_streq(opt->name, "exclude-file")) { + if (optarg != NULL) { csync_args->exclude_file = c_strdup(optarg); /* printf("Argument: exclude-file: %s\n", csync_args->exclude_file); */ + } } else if(c_streq(opt->name, "debug-level")) { csync_args->debug_level = atoi(optarg); } else if(c_streq(opt->name, "disable-statedb")) {