[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Uninitialized variable in npp_reduce_ineq_coef
From: |
Domingo Alvarez Duarte |
Subject: |
Uninitialized variable in npp_reduce_ineq_coef |
Date: |
Fri, 25 Sep 2020 14:08:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello !
Looking through the code and changing "glp_double" by "glp_long_double"
in my GLPK fork I found an unitialized variable in npp_reduce_ineq_coef
in "src/npp/npp4.c":
====
int npp_reduce_ineq_coef(NPP *npp, NPPROW *row)
{ /* reduce inequality constraint coefficients */
NPPROW *copy;
NPPAIJ *aij;
struct elem *ptr, *e;
int kase, count[2];
glp_double b; //***********!!!!!!!!! here not initialized
/* the row must be inequality constraint */
xassert(row->lb < row->ub);
count[0] = count[1] = 0;
for (kase = 0; kase <= 1; kase++)
{ if (kase == 0)
{ /* process row lower bound */
if (row->lb == -GLP_DBL_MAX) continue;
#ifdef GLP_DEBUG
xprintf("L");
#endif
ptr = copy_form(npp, row, +1.0);
b = + row->lb; ////****!!!!!! if it enter here when kase ==
0 then we are using "b" uninitialized
}
====
Cheers !
- Uninitialized variable in npp_reduce_ineq_coef,
Domingo Alvarez Duarte <=