This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug found


Thanks for the bug report, I've corrected the code.

Remy Bruno writes:
 > Hi, I have found a bug in gsl.
 >  In file multifit/lmpar.c, in function compute_newton_direction,
 > the "for (j = nsing - 1; j > 0; j--)" statement isn't correct: as j
 > is declared as size_t and size_t (at least on my sun station, but I
 > think on linux, it is the same) is an unsigned int type, if nsing
 > is 0 (which can apparently happen), j will start at INT_MAX-1 and
 > the loop will begin in spite of the "j > 0" condition.
 >  A quite simple solution is to add a "if (nsing>0)" in front of
 > this statement, but maybe using a simple "int" instead of a size_t
 > for loop counters would be better?
 >  Best regards, Rémy BRUNO
 >




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]