From 8950afd36a1426ed29fb796af0ce0932e8545fe2 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Fri, 13 Jul 2018 19:13:13 +0100 Subject: [PATCH] dtcm: Coverity 87565 --- cde/programs/dtcm/server/rerule.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cde/programs/dtcm/server/rerule.c b/cde/programs/dtcm/server/rerule.c index 1d52ed1a..fe8079a4 100644 --- a/cde/programs/dtcm/server/rerule.c +++ b/cde/programs/dtcm/server/rerule.c @@ -93,18 +93,18 @@ ReToString( cmd_buf_tmp = cmd_buf; if (cmd_buf) cmd_buf_size = strlen(cmd_buf); - if (subcommand) subcommand_size = strlen(subcommand); + subcommand_size = strlen(subcommand); cmd_buf = (char *)calloc(1, cmd_buf_size + subcommand_size + 2); if (cmd_buf_tmp) strcat (cmd_buf, cmd_buf_tmp); - if (subcommand) { - if (cmd_buf_tmp) - strcat (cmd_buf, " "); - strcat (cmd_buf, subcommand); - } + + if (cmd_buf_tmp) + strcat (cmd_buf, " "); + strcat (cmd_buf, subcommand); + memset (subcommand, 0, 1024); -- 2.25.1