Mercurial > octave-nkf
diff libinterp/corefcn/load-path.cc @ 19438:c2f4f6eb5907
A few more instances of stricter input validation for strings (bug #42651).
* load-path.cc (Faddpath, Frmpath): Use is_string() to check string input.
* urlwrite.cc (Furlwrite, Furlread): Use is_string() to check string input.
* variables.cc (extract_function, set_internal_variable): Use is_string() to
check string input.
* ov-class.cc (Fclass): Use is_string() to check string input.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 16 Dec 2014 12:07:32 -0800 |
parents | 03067dab10ca |
children | b9cb664404b9 |
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.cc Tue Dec 16 09:21:29 2014 -0800 +++ b/libinterp/corefcn/load-path.cc Tue Dec 16 12:07:32 2014 -0800 @@ -2437,10 +2437,10 @@ for (int i = 0; i < nargin; i++) { - std::string arg = args(i).string_value (); - - if (! error_state) + if (args(i).is_string ()) { + std::string arg = args(i).string_value (); + std::list<std::string> dir_elts = split_path (arg); if (! append) @@ -2506,10 +2506,9 @@ for (int i = 0; i < nargin; i++) { - std::string arg = args(i).string_value (); - - if (! error_state) + if (args(i).is_string ()) { + std::string arg = args(i).string_value (); std::list<std::string> dir_elts = split_path (arg); for (std::list<std::string>::const_iterator p = dir_elts.begin ();