From dd3526aae6ef530f6a5356fbe36819c9195fe416 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Thu, 28 Jun 2007 21:48:54 +0000 Subject: [PATCH] 2007-06-28 Michael Snyder * cli/cli-script.c (build_command_line): Add null pointer guard (Coverity). --- gdb/ChangeLog | 5 +++++ gdb/cli/cli-script.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ca292746719..bea69db22d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-06-28 Michael Snyder + + * cli/cli-script.c (build_command_line): Add null pointer guard + (Coverity). + 2007-06-27 Daniel Jacobowitz * linux-thread-db.c (thread_db_attach): Delete. diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index ad64a4a65b1..2dff85e69da 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -95,7 +95,9 @@ build_command_line (enum command_control_type type, char *args) = (struct command_line **) xmalloc (sizeof (struct command_line *) * cmd->body_count); memset (cmd->body_list, 0, sizeof (struct command_line *) * cmd->body_count); - cmd->line = savestring (args, strlen (args)); + if (args != NULL) + cmd->line = savestring (args, strlen (args)); + return cmd; } -- 2.30.2