# HG changeset patch # User Jaroslav Hajek # Date 1295299169 -3600 # Node ID 05b5bcdb09c8151f362198c0d1efb1de350c9db0 # Parent 26a6435857bc7af255bc882a4702188e9eef9c35 validate opts in lookup diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-01-17 Jaroslav Hajek + + * DLD-FUNCTION/lookup.cc (Flookup): Validate option string. + 2011-01-17 John W. Eaton * ov-usr-fcn.cc (octave_user_function::bind_automatic_vars): diff --git a/src/DLD-FUNCTIONS/lookup.cc b/src/DLD-FUNCTIONS/lookup.cc --- a/src/DLD-FUNCTIONS/lookup.cc +++ b/src/DLD-FUNCTIONS/lookup.cc @@ -264,6 +264,12 @@ right_inf = contains_char (opt, 'r'); match_idx = contains_char (opt, 'm'); match_bool = contains_char (opt, 'b'); + if (opt.find_first_not_of ("lrmb") != std::string::npos) + { + error ("lookup: unrecognized option: %c", + opt[opt.find_first_not_of ("lrmb")]); + return retval; + } } if ((match_idx || match_bool) && (left_inf || right_inf))