From 3c055ba1f3974f897500decae49f925bb7385f49 Mon Sep 17 00:00:00 2001 From: Baptiste Lepilleur Date: Thu, 17 Jun 2004 17:37:09 +0000 Subject: src/cppunit/TestPath.cpp: bug #938753, array bound read in splitPathString() with substr if an empty string is passed. --- src/cppunit/TestPath.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cppunit/TestPath.cpp') diff --git a/src/cppunit/TestPath.cpp b/src/cppunit/TestPath.cpp index 2f4903f..6a73b43 100644 --- a/src/cppunit/TestPath.cpp +++ b/src/cppunit/TestPath.cpp @@ -226,7 +226,7 @@ bool TestPath::splitPathString( const std::string &pathAsString, PathTestNames &testNames ) { - bool isRelative = (pathAsString.substr(0,1) != "/"); + bool isRelative = pathAsString.length() && pathAsString[0] != "/"; int index = (isRelative ? 0 : 1); while ( true ) -- cgit v1.2.1