2007-06-28 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 28 Jun 2007 21:48:54 +0000 (21:48 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 28 Jun 2007 21:48:54 +0000 (21:48 +0000)
* cli/cli-script.c (build_command_line): Add null pointer guard
(Coverity).

gdb/ChangeLog
gdb/cli/cli-script.c

index ca2927467193b6561aff7bcc78b16edf7c8f98fa..bea69db22d0958383e7f227d70b23baa69375155 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-28  Michael Snyder  <msnyder@access-company.com>
+
+       * cli/cli-script.c (build_command_line): Add null pointer guard 
+       (Coverity).
+       
 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * linux-thread-db.c (thread_db_attach): Delete.
index ad64a4a65b18e8b83e4b15dd364b7aa0401e86e7..2dff85e69da49495f98f47e99d65568782dacfc9 100644 (file)
@@ -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;
 }