[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
19990629: cfltbop.c bug
- Subject: 19990629: cfltbop.c bug
- Date: Tue, 29 Jun 1999 09:38:01 -0600
There is a small bug in cfltbop.c which causes an array error:
/*
* Extract the filename from the end of the path.
*/
done = G_FALSE;
lenname = strlen (pathfile);
cpos = lenname;
while ( (done == G_FALSE) && (cpos >= 0) ) {
cpos--;
if ( pathfile[cpos] == '/' || pathfile[cpos] == ':' ) {
done = G_TRUE;
}
}
The comparison (cpos >= 0) should be (cpos > 0).
cpos is decremented inside the while loop and if
allowed to be equal to zero, will result in pathfile[cpos].
This error is a problem with HPUX-11.0.
Steve Chiswell
Unidata User Support