coin-or / Clp

COIN-OR Linear Programming Solver
Other
392 stars 82 forks source link

Fix possible buffer overflow in `ClpSimplexOther` #279

Closed Mart-Bogdan closed 2 weeks ago

Mart-Bogdan commented 11 months ago

I have found this as warning from GCC when was installing some packages from AUR.

There is possibility of buffer overflow, especially in this case:

sprintf(line, "Odd first line %s on file %s?", line, dataFile);

Because we are using content of array line inside template, and it can be 199 chars already.

Actually offending line was already fixed in upstrem (this repo) by using buffer of size 300, but anyway using snprintf is safer.

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.