[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6711-g6ecb24d

Stephen Kelly steveire at gmail.com
Mon Jan 6 11:22:45 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  6ecb24df904e230a820b87d7f503780dc38d6e14 (commit)
       via  e980e1ca49f16f392ceab5cf95ab763b4078a465 (commit)
      from  560bf07a00b3a273a11e987d37adbd97017173a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ecb24df904e230a820b87d7f503780dc38d6e14
commit 6ecb24df904e230a820b87d7f503780dc38d6e14
Merge: 560bf07 e980e1c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 11:22:44 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Jan 6 11:22:44 2014 -0500

    Merge topic 'minor-cleanups' into next
    
    e980e1c Don't overflow the char pointer when finding the suffix.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e980e1ca49f16f392ceab5cf95ab763b4078a465
commit e980e1ca49f16f392ceab5cf95ab763b4078a465
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Jan 6 16:47:44 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Jan 6 16:50:12 2014 +0100

    Don't overflow the char pointer when finding the suffix.

diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 783afe7..ebfa8f9 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -395,14 +395,16 @@ inline bool cmHasLiteralSuffixImpl(const std::string &str1,
                                    const char *str2,
                                    size_t N)
 {
-  return strcmp(str1.c_str() + str1.size() - N, str2) == 0;
+  size_t len = str1.size();
+  return len >= N && strcmp(str1.c_str() + len - N, str2) == 0;
 }
 
 inline bool cmHasLiteralSuffixImpl(const char* str1,
                                    const char* str2,
                                    size_t N)
 {
-  return strcmp(str1 + strlen(str1) - N, str2) == 0;
+  size_t len = strlen(str1);
+  return len >= N && strcmp(str1 + len - N, str2) == 0;
 }
 
 #if defined(_MSC_VER) && _MSC_VER < 1300 \

-----------------------------------------------------------------------

Summary of changes:
 Source/cmStandardIncludes.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list