diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2011-08-22 11:30:26 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-21 22:20:55 +0200 |
commit | 53aa54fb94275ceb54f20f37b75045f5fbf708c9 (patch) | |
tree | ed8e3d32730ddf0136592b0d3a48f776a3fe0976 /src/corelib/io/qtemporaryfile.cpp | |
parent | 5658572a27afe912313909544fdc449d93633e4c (diff) |
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_
(cherry picked from commit 7b693627ee2a17718cb6d8bee5e3deb5a97b307f)
Change-Id: I61a1511bca5cafe2edde20ef38c23154200dfcab
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/io/qtemporaryfile.cpp')
-rw-r--r-- | src/corelib/io/qtemporaryfile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index afef67493e..ebcaaa71bd 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; |