aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crm114-exec.c7
-rw-r--r--dspam-exec.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/crm114-exec.c b/crm114-exec.c
index 360346b..7727409 100644
--- a/crm114-exec.c
+++ b/crm114-exec.c
@@ -33,8 +33,6 @@ static const char *reaver_binary = "/bin/false";
static char **extra_args = NULL;
static int extra_args_num = 0;
-#define FIXED_ARGS_NUM 2
-
static int call_reaver(const char *signature, enum classification wanted)
{
pid_t pid;
@@ -86,7 +84,8 @@ static int call_reaver(const char *signature, enum classification wanted)
} else {
int fd = open("/dev/null", O_RDONLY);
char **argv;
- int sz = sizeof(char *) * (FIXED_ARGS_NUM + extra_args_num + 1);
+ /* 2 fixed, extra, terminating NULL */
+ int sz = sizeof(char *) * (2 + extra_args_num + 1);
int i;
argv = i_malloc(sz);
@@ -112,7 +111,7 @@ static int call_reaver(const char *signature, enum classification wanted)
argv[1] = (char *)class_arg;
for (i = 0; i < extra_args_num; i++)
- argv[i + FIXED_ARGS_NUM] = (char *)extra_args[i];
+ argv[i + 2] = (char *)extra_args[i];
debugv(argv);
diff --git a/dspam-exec.c b/dspam-exec.c
index 2f37c36..b0316aa 100644
--- a/dspam-exec.c
+++ b/dspam-exec.c
@@ -33,8 +33,6 @@ static const char *dspam_binary = "/usr/bin/dspam";
static char **extra_args = NULL;
static int extra_args_num = 0;
-#define FIXED_ARGS_NUM 5
-
static int call_dspam(const char *signature, enum classification wanted)
{
pid_t pid;
@@ -103,7 +101,8 @@ static int call_dspam(const char *signature, enum classification wanted)
} else {
int fd = open("/dev/null", O_RDONLY);
char **argv;
- int sz = sizeof(char *) * (FIXED_ARGS_NUM + extra_args_num);
+ /* 4 fixed args, extra args, terminating NULL */
+ int sz = sizeof(char *) * (4 + extra_args_num + 1);
int i;
argv = i_malloc(sz);