findutils - Patches: patch #2952, getline off-by-one bugfix
You are not allowed to post comments on this tracker with your current authentication level.
patch #2952: getline off-by-one bugfix
Submitter: | James Youngman <jay> | ||
Submitted: | Mon 19 Apr 2004 07:54:40 PM UTC | ||
Category: | None | Priority: | 1 - Later |
Status: | Done | Privacy: | Public |
Assigned to: | jay | Originator Name: | |
Open/Closed: | Closed | Release: | None |
Fixed Release: | None |
Attached Files
Depends on the following items: None found
Items that depend on this one: None found
CC list is empty
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 5 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2004-10-31 | jay | Open/Closed | Open | Closed | |
2004-10-30 | jay | Status | None | Done | |
Assigned to | None | jay | |||
2004-04-19 | jay | Attached File | - | Added locate-off-by-one.diff, #3125 | |
Carbon-Copy | - | Added davidn --AT-- rebel --DOT-- net --DOT-- au |
Powered by Savane 3.13-02a9.
Corresponding source code
After some discussion on bug-gnulib, David Newall writes :-
There's merit to Bruno's idea that the database must have been corrupt, although it must necessarily have been created corrupt. 4.1.20 creates the database in a completely different way to 4.1.7, and unfortunately I've made major changes to my file system since last updatedb and the
bug is no longer triggered. Offset should always be in the range [0..length of last path] and so the best I can suggest is an assertion to ensure that it's never out of range.
It turns out that there's a completely new bug in the 4.1.20 locate, an off by relating to the null terminator appended by getdelim2().
Here's a patch which corrects the off by one bug, and which adds the requisite assert. It's untested to the extent that I haven't reproduced a database which exposes the bug in 4.1.7 so I don't know if 4.1.20 has the same problem. My guess is it doesn't because updatedb works in such a diferent way. The patch certainly doesn't cause any new problems.
Regards,
David