changeset 28745:ffdb29f7baab

Avoid incorrect conversion of char matrix to string when setting graphic properties (bug #59113) * graphics.cc (set_value_or_default): Check that octave_value is_string AND has only one row before calling string_value().
author Rik <rik@octave.org>
date Mon, 14 Sep 2020 14:38:42 -0700
parents 2cd4a32cbc4b
children 7dcc4cb6da53
files libinterp/corefcn/graphics.cc
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Mon Sep 14 12:12:31 2020 -0700
+++ b/libinterp/corefcn/graphics.cc	Mon Sep 14 14:38:42 2020 -0700
@@ -2736,7 +2736,7 @@
 graphics_object::set_value_or_default (const caseless_str& pname,
                                        const octave_value& val)
 {
-  if (val.is_string ())
+  if (val.is_string () && val.rows () == 1)
     {
       std::string sval = val.string_value ();