# HG changeset patch # User Jaroslav Hajek # Date 1219168770 14400 # Node ID c51deec2faf19fcbc10a64053b8ae7c4e3e5beee # Parent 10697d2d7f4f59a0db525a0b1b42fcb2f9e4ee43 fix invalid memory read in glpk diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -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 --git a/scripts/optimization/glpk.m b/scripts/optimization/glpk.m --- a/scripts/optimization/glpk.m +++ b/scripts/optimization/glpk.m @@ -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 --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/DLD-FUNCTIONS/__glpk__.cc b/src/DLD-FUNCTIONS/__glpk__.cc --- a/src/DLD-FUNCTIONS/__glpk__.cc +++ b/src/DLD-FUNCTIONS/__glpk__.cc @@ -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;