[Gambas-devel] Bug detected in gb.data
Tobias Boege
tobias at ...692...
Sat Jan 5 15:34:29 CET 2013
On Sat, 05 Jan 2013, Emil Lenngren wrote:
> That function is never called...
>
> 2013/1/5 Beno?t Minisini <gambas at ...1...>
>
> > Hi, Tobias.
> >
> > The Coverity Scan software has detected the following problem in gb.data :
> >
> > The following function in 'c_list.c' is incorrect:
> >
> > static inline int VAL_is_valid(VAL *val)
> > {
> > int i = val->fidx + val->ck->first;
> > int j = val->lidx + val->ck->last;
> >
> > if (i != j || !val->ck || val->fidx == -1 || i > val->ck->last)
> > return 0;
> > return 1;
> > }
> >
> > because 'val->ck->first' is accessed before being null-checked.
> >
> > I don't know if it is problematic, but it seems. Can you check that?
> >
> > Thanks!
This fact would indeed be problematic according to the function's semantics
but Emil is right, it's not used anywhere. OK, that's embarrassing :-)
Removed in rev#5491. I checked that file again and this seems to have been
the only unused function (must have been a leftover or so).
Thanks,
Tobi
More information about the Devel
mailing list