diff --git a/cmake/version.cmake b/cmake/version.cmake index b0c6080..e85f078 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -4,7 +4,7 @@ set (TK_UTIL_MAJOR_VERSION "6") set (TK_UTIL_MINOR_VERSION "14") -set (TK_UTIL_RELEASE_VERSION "0") +set (TK_UTIL_RELEASE_VERSION "1") set (TK_UTIL_VERSION ${TK_UTIL_MAJOR_VERSION}.${TK_UTIL_MINOR_VERSION}.${TK_UTIL_RELEASE_VERSION}) set (TK_UTIL_SCRIPTING_MAJOR_VERSION ${TK_UTIL_MAJOR_VERSION}) diff --git a/src/TkUtil/UnicodeString.cpp b/src/TkUtil/UnicodeString.cpp index 58abd8c..61518b0 100644 --- a/src/TkUtil/UnicodeString.cpp +++ b/src/TkUtil/UnicodeString.cpp @@ -419,8 +419,7 @@ bool UnicodeString::operator == (const UnicodeString& toCompare) const if (length ( ) != toCompare.length ( )) return false; - return 0 == memcmp (unicode ( ), toCompare.unicode ( ), - length ( ) * sizeof (WChar_t)); + return 0 == memcmp (unicode ( ), toCompare.unicode ( ), length ( ) * sizeof (WChar_t)); } // UnicodeString::operator == @@ -889,7 +888,8 @@ void UnicodeString::copy (const UnicodeString& str) _length = str.length ( ); _string = new WChar_t [_length + 1]; CHECK_NULL_PTR_ERROR (_string) - memcpy (_string, str.unicode ( ), _length * sizeof (WChar_t)); + if (0 != unicode ( )) // v 6.14.1 + memcpy (_string, str.unicode ( ), _length * sizeof (WChar_t)); _string [_length] = 0; } // UnicodeString::copy @@ -903,7 +903,8 @@ void UnicodeString::copy (const WChar_t* str) _length = stringLength (str); _string = new WChar_t [_length + 1]; CHECK_NULL_PTR_ERROR (_string) - memcpy (_string, str, _length * sizeof (WChar_t)); + if (0 != unicode ( )) // v 6.14.1 + memcpy (_string, str, _length * sizeof (WChar_t)); _string [_length] = 0; } // UnicodeString::copy @@ -942,9 +943,10 @@ UnicodeString operator + (const UnicodeString& us1, const UnicodeString& us2) const size_t length = us1.length ( ) + us2.length ( ); WChar_t* str = new WChar_t [length + 1]; CHECK_NULL_PTR_ERROR (str) - memcpy (str, us1.unicode ( ), us1.length ( ) * sizeof (WChar_t)); - memcpy (str + us1.length ( ), us2.unicode ( ), - us2.length ( ) * sizeof (WChar_t)); + if (0 != us1.unicode ( )) // v 6.14.1 + memcpy (str, us1.unicode ( ), us1.length ( ) * sizeof (WChar_t)); + if (0 != us2.unicode ( )) // v 6.14.1 + memcpy (str + us1.length ( ), us2.unicode ( ), us2.length ( ) * sizeof (WChar_t)); str [length] = 0; UnicodeString us (str); diff --git a/versions.txt b/versions.txt index 223275b..87ab3d7 100644 --- a/versions.txt +++ b/versions.txt @@ -1,3 +1,9 @@ +Version 6.14.1 : 20/02/26 +================= + +Correctif UnicodeString, appels à memcpy, mis en évidence par GNU et LLVM sanitizer lorsque la chaîne est nulle. + + Version 6.14.0 : 07/11/25 =================