bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uninitialized variable in npp_reduce_ineq_coef


From: Andrew Makhorin
Subject: Re: Uninitialized variable in npp_reduce_ineq_coef
Date: Fri, 25 Sep 2020 15:23:15 +0300

On Fri, 2020-09-25 at 14:08 +0200, Domingo Alvarez Duarte wrote:
> 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

This is assignment, not increment.

>           }
> 
> ====
> 
> Cheers !
> 
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]