# HG changeset patch # User Rik # Date 1317315962 25200 # Node ID 248d05c413dc47be312c29ad2a06896a3617639c # Parent 00c5d8d3ee004b71a39e70d291f6ff817d2388bc 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. diff --git a/scripts/plot/private/__line__.m b/scripts/plot/private/__line__.m --- 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 = {};