From a09e40cba39a63b85626a46b238ec38c603a8d69 Mon Sep 17 00:00:00 2001 From: carl Date: Tue, 26 Mar 2019 00:58:56 +0800 Subject: [PATCH] Fix memory overflow error. --- fast/driver/driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fast/driver/driver.c b/fast/driver/driver.c index 4ff6358b4..f78a1d002 100644 --- a/fast/driver/driver.c +++ b/fast/driver/driver.c @@ -865,7 +865,8 @@ static int runvec(struct arglist *vec, char *outp) } if(outp != NULL) { - redirect = alloc(strlen(outp)+sizeof(char)*2); + /* Don't forget the null character. */ + redirect = alloc(strlen(outp)+sizeof(char)*3); strcpy(redirect,"1>"); strcat(redirect,outp); append(vec,redirect);