[Coin-discuss] 2 error + 1 ,may be, recommended correction

sandor szedmak ss03v at ecs.soton.ac.uk
Thu Mar 11 06:15:13 EST 2004


Hi,

I just started to use Clp from COIN.
I found two buffer overflow errors:

---------------------------------------------------
1.
In the file:
    ClpDualRowSteepest.cpp 
the buffer infeasible_ goes beyond its capacity.

The error can be produced by
    clp -unitTest
using the file
    finnis.mps

A possible correction can be
      infeasible_ = new CoinIndexedVector();
      infeasible_->reserve(max(numberRows,numberColumns));
or
      infeasible_ = new CoinIndexedVector();
      infeasible_->reserve(numberRows+numberColumns);
in the function
    ClpDualRowSteepest::saveWeights(ClpSimplex * model,int mode)

The original version is
      infeasible_ = new CoinIndexedVector();
      infeasible_->reserve(numberRows);
--------------------------------------------------
2.
In the file
    ClpPrimalColumnSteepest.cpp
the buffer infeasible_ does the same that is in ClpDualRowSteepest.cpp.

The error can be produced by
    clp -unitTest
using the file
    brandy.mps

 Here the correction that was suggested previously has been made already.
( to increase the size of infeasible_ by use of 
infeasible_->reserve(numberRows+numberColumns); )

It happens in the function

ClpPrimalColumnSteepest::pivotColumn(CoinIndexedVector * updates,
                    CoinIndexedVector * spareRow1,
                    CoinIndexedVector * spareRow2,
                    CoinIndexedVector * spareColumn1,
                    CoinIndexedVector * spareColumn2)

To change "quickAdd" to "add" does not help on this problem.
Unfortunately I have not found a appropriate correction to this error yet.

-------------------------------------------------
My programming environment:

Suse Linux 8.2(Intel Pentium),
GNU C++  3.3-23
Coin + Clp was downloaded by cvs on 8/03/2004
------------------------------------------------

Best regards

Sandor Szedmak
Electronics and Computer Science
University of Southampton
United Kingdom





More information about the Coin-discuss mailing list