diff --git a/Foundation/src/UUID.cpp b/Foundation/src/UUID.cpp index d42494babd..885708c0a3 100644 --- a/Foundation/src/UUID.cpp +++ b/Foundation/src/UUID.cpp @@ -134,7 +134,7 @@ bool UUID::tryParse(const std::string& uuid) bool haveHyphens = false; if (uuid[8] == '-' && uuid[13] == '-' && uuid[18] == '-' && uuid[23] == '-') { - if (uuid.size() >= 36) + if (uuid.size() == 36) haveHyphens = true; else return false; diff --git a/Foundation/testsuite/src/UUIDTest.cpp b/Foundation/testsuite/src/UUIDTest.cpp index 5765dc0643..d83dc088db 100644 --- a/Foundation/testsuite/src/UUIDTest.cpp +++ b/Foundation/testsuite/src/UUIDTest.cpp @@ -92,6 +92,15 @@ void UUIDTest::testParse() catch (Poco::SyntaxException&) { } + + try + { + uuid.parse("495cff3a-a4b3-11ee-9e54-9cb6d0f68b51AA"); + fail("invalid UUID - must throw"); + } + catch (Poco::SyntaxException&) + { + } }