Details
Description
This is a regression.
while (!dir_iterator.next().isEmpty())
segfaults with 6.8 but not with 6.5 on macOS.
Qt docs on `next()`
If hasNext() returns false, this function does nothing, and returns an empty QString.
This
while (fIt.hasNext())
{
DEBG << fIt.next();
works on 6.8 and 6.5.
The source seems to be QDirListing. See here for some backtraces and some more info.
Attachments
Issue Links
- relates to
-
QTBUG-135287 QDirIterator::next no longer returns "" upon iterator exhaustion
-
- Closed
-
For Gerrit Dashboard: QTBUG-130142 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
597865,4 | QDirIterator: don't crash with next() after hasNext() returned false | dev | qt/qtbase | Status: MERGED | +2 | 0 |
598230,2 | QDirIterator: don't crash with next() after hasNext() returned false | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |
635239,3 | QDirIterator: next() should return empty string after reaching the end | dev | qt/qtbase | Status: MERGED | +2 | 0 |
636142,2 | QDirIterator: next() should return empty string after reaching the end | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |
636177,2 | QDirIterator: next() should return empty string after reaching the end | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |