From 9c41981502f085e20dfd9f4ef322d430d9500721 Mon Sep 17 00:00:00 2001 From: Ahurac Date: Fri, 8 Nov 2024 11:50:55 +0100 Subject: [PATCH] fix(parse): bug where args aren't null terminated --- src/parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/parse.c b/src/parse.c index 2daf97c..280e800 100644 --- a/src/parse.c +++ b/src/parse.c @@ -19,6 +19,7 @@ void add_arg(struct Args *args, char *arg_ptr, unsigned int arg_length) { char *arg = malloc(arg_length + 1); strncpy(arg, arg_ptr, arg_length); + arg[arg_length] = '\0'; args->argv[args->argc] = arg; args->argc++;