Mercurial > hg > octave-terminal
changeset 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 | 00c5d8d3ee00 |
children | fd9187676535 |
files | scripts/plot/private/__line__.m |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
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 = {};