Mercurial > octave-nkf
diff libinterp/octave-value/ov-class.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 | 76478d2da117 |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-class.cc Tue Dec 16 09:21:29 2014 -0800 +++ b/libinterp/octave-value/ov-class.cc Tue Dec 16 12:07:32 2014 -0800 @@ -1875,10 +1875,10 @@ // Called as class constructor octave_function *fcn = octave_call_stack::caller (); - std::string id = args(1).string_value (); + if (args(1).is_string ()) + { + std::string id = args(1).string_value (); - if (! error_state) - { if (fcn) { if (fcn->is_class_constructor (id) || fcn->is_class_method (id))