From 888e1935112ac90b77d8cdbd146a8aa2c45bcce8 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic Date: Fri, 6 Oct 2017 17:50:01 -0500 Subject: [PATCH] Exception when using SortedDirectoryIterator #1926 --- Foundation/src/SortedDirectoryIterator.cpp | 8 +++++++- Foundation/testsuite/src/NumberParserTest.cpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Foundation/src/SortedDirectoryIterator.cpp b/Foundation/src/SortedDirectoryIterator.cpp index 6eabf50ca..22a10bc82 100644 --- a/Foundation/src/SortedDirectoryIterator.cpp +++ b/Foundation/src/SortedDirectoryIterator.cpp @@ -78,7 +78,13 @@ void SortedDirectoryIterator::scan() DirectoryIterator end_it; while (*this != end_it) { - if ((*this)->isDirectory()) + bool isDir = false; + try + { + isDir = (*this)->isDirectory(); + } + catch (...) { } + if (isDir) _directories.push_back(_path.toString()); else _files.push_back(_path.toString()); diff --git a/Foundation/testsuite/src/NumberParserTest.cpp b/Foundation/testsuite/src/NumberParserTest.cpp index b0a686153..699cba33b 100644 --- a/Foundation/testsuite/src/NumberParserTest.cpp +++ b/Foundation/testsuite/src/NumberParserTest.cpp @@ -260,7 +260,7 @@ void NumberParserTest::testParseError() failmsg("must throw SyntaxException"); } catch (SyntaxException&) {} - + #if defined(POCO_HAVE_INT64) try @@ -286,7 +286,7 @@ void NumberParserTest::testParseError() NumberParser::parseHex64("12345z"); failmsg("must throw SyntaxException"); } catch (SyntaxException&) { } - + try { NumberParser::parseHex64(format("123%c45", ts));