summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2004-06-17 17:37:09 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2004-06-17 17:37:09 +0000
commit3c055ba1f3974f897500decae49f925bb7385f49 (patch)
treef9beb92d4c4016ff2cf4fc2ce9ffca9ccdca7184
parent5c9ce8e024326a9dc71c67463f0f75fbf8daed07 (diff)
downloadcppunit-3c055ba1f3974f897500decae49f925bb7385f49.tar.gz
src/cppunit/TestPath.cpp: bug #938753, array bound read in
splitPathString() with substr if an empty string is passed.
-rw-r--r--ChangeLog3
-rw-r--r--NEWS3
-rw-r--r--src/cppunit/TestPath.cpp2
3 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a7b7faa..5f79bb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,9 @@
* doc/Makefile.am: fixed bug #940650 => cp -dpR, removed option -p since
there is no link to preserve anyway (does not exist on SunOs).
+ * src/cppunit/TestPath.cpp: bug #938753, array bound read in
+ splitPathString() with substr if an empty string is passed.
+
2004-06-16 Baptiste Lepilleur <gaiacrtn@free.fr>
diff --git a/NEWS b/NEWS
index a81f92f..8886ffa 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@
* Bug Fix:
+ - Memory checker: bug #938753, array bound read in
+ splitPathString() with substr if an empty string is passed.
+
* Compilation:
- Compilation: mingw & cigwin, bug #930338 & #945737 fixed.
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 )