From: Peter Krempa Date: Mon, 23 Nov 2020 08:59:54 +0000 (+0100) Subject: virCommandAddArg: Don't abort on invalid input X-Git-Tag: v6.10.0-rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a252ab4d1cc893cb70b67f4467ebf4fc6cc47e6;p=thirdparty%2Flibvirt.git virCommandAddArg: Don't abort on invalid input Commit 912c6b22fc622cd7c7d29c7f8eaeb816b266daac added abort() when the 'val' parameter is NULL along with setting the error variable for the command. We don't want to abort in this case, just set the error. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 9a4f3d7f32..5117467c1d 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -1503,7 +1503,7 @@ virCommandAddArg(virCommandPtr cmd, const char *val) if (val == NULL) { cmd->has_error = EINVAL; - abort(); + return; } arg = g_strdup(val);