summaryrefslogtreecommitdiff
path: root/src/cppunit/TestPath.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2004-06-17 18:16:49 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2004-06-17 18:16:49 +0000
commite9f2d7bcb6cc12025e6eedc2e89f928d1bbae70d (patch)
tree3384396cfef567aaeb2433b373f65e721e36bfc3 /src/cppunit/TestPath.cpp
parentf29095da66d810684c4e533ad506b109878e874d (diff)
downloadcppunit-e9f2d7bcb6cc12025e6eedc2e89f928d1bbae70d.tar.gz
src/cppunit/TestPath.cpp: bug #938753, array bound read in
splitPathString() with substr if an empty string is passed.
Diffstat (limited to 'src/cppunit/TestPath.cpp')
-rw-r--r--src/cppunit/TestPath.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cppunit/TestPath.cpp b/src/cppunit/TestPath.cpp
index 5ff1466..a2783a2 100644
--- a/src/cppunit/TestPath.cpp
+++ b/src/cppunit/TestPath.cpp
@@ -226,7 +226,10 @@ bool
TestPath::splitPathString( const std::string &pathAsString,
PathTestNames &testNames )
{
- bool isRelative = pathAsString.length() && pathAsString[0] != '/';
+ if ( pathAsString.empty() )
+ return true;
+
+ bool isRelative = pathAsString[0] != '/';
int index = (isRelative ? 0 : 1);
while ( true )