changeset 26508:97a37df42734 stable

oct-rl-edit.c: Fix static analyzer detected issues (bug #55347). * oct-rl-edit.c (OCTAVE_RL_SAVE_STRING): Check validity of "ss" pointer before calling strcpy.
author Rik <rik@octave.org>
date Tue, 08 Jan 2019 21:20:13 -0800
parents f1f8cd686fcd
children 0fba2d918b65
files liboctave/util/oct-rl-edit.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/util/oct-rl-edit.c	Tue Jan 08 21:11:37 2019 -0800
+++ b/liboctave/util/oct-rl-edit.c	Tue Jan 08 21:20:13 2019 -0800
@@ -44,7 +44,8 @@
  \
   ss = malloc (strlen (s) + 1); \
  \
-  strcpy (ss, s)
+  if (ss) \
+    strcpy (ss, s)
 
 void
 octave_rl_redisplay (void)