diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-06-17 17:37:09 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2004-06-17 17:37:09 +0000 |
| commit | 3c055ba1f3974f897500decae49f925bb7385f49 (patch) | |
| tree | f9beb92d4c4016ff2cf4fc2ce9ffca9ccdca7184 | |
| parent | 5c9ce8e024326a9dc71c67463f0f75fbf8daed07 (diff) | |
| download | cppunit-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-- | ChangeLog | 3 | ||||
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | src/cppunit/TestPath.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
@@ -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> @@ -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 ) |
