# HG changeset patch # User Jaroslav Hajek # Date 1219168770 14400 # Node ID 854683691d7a58b8f38adf305b2ddb0232cdd003 # Parent 1720d4fab3fa99f0ce3b3af85572f5d5a51330a4 fix invalid memory read in glpk diff -r 1720d4fab3fa -r 854683691d7a scripts/ChangeLog --- a/scripts/ChangeLog Tue Aug 19 13:52:18 2008 -0400 +++ b/scripts/ChangeLog Tue Aug 19 13:59:30 2008 -0400 @@ -1,3 +1,7 @@ +2008-08-19 Jaroslav Hajek + + * optimization/glpk.m: Fix invalid call to zeros. + 2008-08-19 David Bateman statistics/base/ranks.m: Doc fix. diff -r 1720d4fab3fa -r 854683691d7a scripts/optimization/glpk.m --- a/scripts/optimization/glpk.m Tue Aug 19 13:52:18 2008 -0400 +++ b/scripts/optimization/glpk.m Tue Aug 19 13:59:30 2008 -0400 @@ -470,7 +470,7 @@ if (nargin > 3) if (isempty (lb)) - lb = zeros (0, nx, 1); + lb = zeros (nx, 1); elseif (! isreal (lb) || all (size (lb) > 1) || length (lb) != nx) error ("LB must be a real valued %d by 1 column vector", nx); return; diff -r 1720d4fab3fa -r 854683691d7a src/ChangeLog --- a/src/ChangeLog Tue Aug 19 13:52:18 2008 -0400 +++ b/src/ChangeLog Tue Aug 19 13:59:30 2008 -0400 @@ -1,5 +1,8 @@ 2008-08-19 Jaroslav Hajek + * DLD-FUNCTIONS/__glpk__.cc (F__glpk__): Checks whether LB and UB are + of proper size. + * oct-obj.cc, oct-obj.h (octave_value_list::make_argv): Allow calling without fcn_name. * load-save.cc (parse_save_options (const string_vector&, ...)): diff -r 1720d4fab3fa -r 854683691d7a src/DLD-FUNCTIONS/__glpk__.cc --- a/src/DLD-FUNCTIONS/__glpk__.cc Tue Aug 19 13:52:18 2008 -0400 +++ b/src/DLD-FUNCTIONS/__glpk__.cc Tue Aug 19 13:59:30 2008 -0400 @@ -575,7 +575,7 @@ //-- bound on each of the variables. Matrix LB (args(3).matrix_value ()); - if (error_state) + if (error_state || LB.length () < mrowsc) { error ("__glpk__: invalid value of lb"); return retval; @@ -600,7 +600,7 @@ //-- bound on each of the variables. Matrix UB (args(4).matrix_value ()); - if (error_state) + if (error_state || UB.length () < mrowsc) { error ("__glpk__: invalid value of ub"); return retval;