# HG changeset patch # User Jaroslav Hajek # Date 1225604652 -3600 # Node ID f2e050b6219912307a396a3c056bb1f660a9d8ae # Parent f7d44b6a74df4e81acfa47c6b74bed845ffb5bb9 fix dim check in Array::delete_elements diff --git a/liboctave/Array.cc b/liboctave/Array.cc --- a/liboctave/Array.cc +++ b/liboctave/Array.cc @@ -1352,7 +1352,7 @@ void Array::delete_elements (int dim, const idx_vector& i) { - if (dim > ndims ()) + if (dim < 0 || dim >= ndims ()) { (*current_liboctave_error_handler) ("invalid dimension in delete_elements"); diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -2,6 +2,8 @@ * idx-vector.cc (idx_vector::is_complement): Set resulting extent correctly. + * Array.cc (Array::delete_elements (int, const idx_vector&)): + Fix check for invalid dim. 2008-10-31 Jaroslav Hajek