summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-08-22 09:30:26 (GMT)
committerJoão Abecasis <joao.abecasis@nokia.com>2011-08-22 09:42:42 (GMT)
commit7b693627ee2a17718cb6d8bee5e3deb5a97b307f (patch)
tree2760ad3179b09a5240744e7ffc2e6d8fb7d7054c /src/corelib
parent9e656ce0f7bda4bca4ae55a7aefe1617bc2805ac (diff)
downloadQt-7b693627ee2a17718cb6d8bee5e3deb5a97b307f.zip
Qt-7b693627ee2a17718cb6d8bee5e3deb5a97b307f.tar.gz
Qt-7b693627ee2a17718cb6d8bee5e3deb5a97b307f.tar.bz2
Off-by-one error in assert condition...
While this was safe, it was also over-zealous, disallowing the path from ending with the placeholder... Incidentally, the default. Laughed-at-by: w00t_
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qtemporaryfile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index ea5f8a5..e80a8b6 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -135,7 +135,7 @@ static bool createFileFromTemplate(NativeFileHandle &file,
{
Q_ASSERT(length != 0);
Q_ASSERT(pos < size_t(path.length()));
- Q_ASSERT(length < size_t(path.length()) - pos);
+ Q_ASSERT(length <= size_t(path.length()) - pos);
Char *const placeholderStart = (Char *)path.data() + pos;
Char *const placeholderEnd = placeholderStart + length;