[Symphony] sym_set_row_type args checking

Ted Ralphs ted at lehigh.edu
Wed Sep 3 01:27:41 EDT 2014


Thanks for reporting this! It is fixed now in trunk.

Cheers,

Ted


On Fri, Aug 29, 2014 at 9:51 AM, Konvicka Filip <Filip.Konvicka at logis.cz>
wrote:

>  Hi,
>
>
>
> I've accidentally called sym_set_row_type() with row index equal to the
> number of rows in the model.  This led to a crash later when Symphony was
> deallocating the related memory block (I believe this was because I had a
> specific model size so the out-of-range row index led to corruption of the
> next heap block).
>
>
>
> I believe the code that checks the row index is too permissive – it
> rejects a negative row index and an index strictly greater than the number
> of rows, but allows the index to be equal to the number of rows.  Similar
> functions that alter the RHS etc. have similar checks that should probably
> be reviewed as well.  Also this is mentioned in the documentation to these
> functions.
>
>
>
> In other words, I would change (I think this is in
> SYMPHONY/src/Master/master.c):
>
>
>
> if (!env->mip || !env->mip->m || index > env->mip->m || index < 0 ||
> !env->mip->rhs){
>
>
>
> to
>
>
>
> if (!env->mip || !env->mip->m || index >= env->mip->m || index < 0 ||
> !env->mip->rhs){
>
>
>
> The condition that tests whether "m" is zero is then not needed (so
> "!env->mip->m" can be omitted).
>
>
>
> Thanks,
>
> Filip
>
>
>
> _______________________________________________
> Symphony mailing list
> Symphony at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/symphony
>
>


-- 
Dr. Ted Ralphs
Associate Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20140903/86cee6ef/attachment.html>


More information about the Symphony mailing list