diff libinterp/corefcn/oct-stream.cc @ 26640:c18e59476795 stable

file id must not be single for textscan and other file I/O funcs (bug #55577) * oct-stream.cc (stream_list::get_info): Error if file id is single precision. (stream_list::get_file_number): Likewise. * file-io.cc: Ensure textscan input validation error is tested.
author Mike Miller <mtmiller@octave.org>
date Sun, 27 Jan 2019 10:53:25 -0800
parents f8d380d04b01
children 29ea2369971d 2310164737b3
line wrap: on
line diff
--- a/libinterp/corefcn/oct-stream.cc	Sun Jan 27 19:01:50 2019 +0100
+++ b/libinterp/corefcn/oct-stream.cc	Sun Jan 27 10:53:25 2019 -0800
@@ -7503,6 +7503,9 @@
   {
     int conv_err = 0;
 
+    if (fid.is_single_type ())
+      ::error ("file id must be a file object or integer value");
+
     int int_fid = convert_to_valid_int (fid, conv_err);
 
     if (conv_err)
@@ -7584,6 +7587,8 @@
               }
           }
       }
+    else if (fid.is_single_type ())
+      ::error ("file id must be a file object, std::string, or integer value");
     else
       {
         int conv_err = 0;