Mercurial > hg > octave-nkf
diff scripts/plot/private/__line__.m @ 13248:248d05c413dc stable
Validate inputs to line() to prevent corrupting graphic toolkit (Bug #32345)
* __line__.m: Validate number of X, Y, and Z points are equal before passing
to plotting toolkit.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Thu, 29 Sep 2011 10:06:02 -0700 |
parents | fd0a3ac60b0e |
children | 571557ddabb9 |
line wrap: on
line diff
--- a/scripts/plot/private/__line__.m +++ b/scripts/plot/private/__line__.m @@ -45,8 +45,12 @@ num_data_args = 0; endif + if (num_data_args > 0 && ! size_equal (varargin{1:num_data_args})) + error ("line: number of X, Y, and Z points must be equal"); + endif + if (rem (nvargs - num_data_args, 2) != 0) - print_usage ("line"); + error ("line: invalid number of PROPERTY / VALUE pairs"); endif data_args = {};