changeset 24752:0c6785fb557c

Add FIXME note to printf_format_list::add_elt_to_list (bug #53148). * oct-stream.cc (printf_format_list::add_elt_to_list): Add FIXME note pointing out that the root of the problem in bug #53148 is the call to c_str() in this function which turns embedded NULL characters into END-OF-STRING marker.
author Rik <rik@octave.org>
date Tue, 13 Feb 2018 15:04:06 -0800
parents 6e670c58c6f0
children ca6a73be15da
files libinterp/corefcn/oct-stream.cc
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Tue Feb 13 13:51:35 2018 -0800
+++ b/libinterp/corefcn/oct-stream.cc	Tue Feb 13 15:04:06 2018 -0800
@@ -979,6 +979,9 @@
 
     if (! text.empty ())
       {
+        // FIXME: The call to c_str() creates a NULL terminated character
+        //        array.  If there are NULLs already in the format text
+        //        then the text is truncated early.  See bug #53148.
         printf_format_elt *elt
           = new printf_format_elt (text.c_str (), args, fw, prec, flags,
                                    type, modifier);