summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJoerg Bruehe <joerg@mysql.com>2010-09-10 20:48:13 +0200
committerJoerg Bruehe <joerg@mysql.com>2010-09-10 20:48:13 +0200
commitf19144c0940475730607d5627609687c8615f70d (patch)
treed672649465fcb9292a9de5dafb534308e0adb2fb /client
parent7bd808548ee52e597cb444a2ef36c593d81fce0b (diff)
parent9defb07e7dec05cbe899c8a63b7929f7232c37b6 (diff)
downloadmariadb-git-f19144c0940475730607d5627609687c8615f70d.tar.gz
Automerge (most) changes of the 5.5.6-rc release build to main 5.5.
This is not the final merge!
Diffstat (limited to 'client')
-rw-r--r--client/CMakeLists.txt5
-rw-r--r--client/sql_string.cc10
2 files changed, 12 insertions, 3 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 771ebf290f1..e39e8d7178a 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -64,7 +64,10 @@ MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqlslap mysqlclient)
-ADD_EXECUTABLE(echo echo.c)
+# "WIN32" also covers 64 bit. "echo" is used in some files below "mysql-test/".
+IF(WIN32)
+ MYSQL_ADD_EXECUTABLE(echo echo.c)
+ENDIF(WIN32)
SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
PROPERTIES HAS_CXX TRUE)
diff --git a/client/sql_string.cc b/client/sql_string.cc
index 6b749409a64..dec6ac94eb2 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -31,9 +31,12 @@
** String functions
*****************************************************************************/
-bool String::real_alloc(uint32 arg_length)
+bool String::real_alloc(uint32 length)
{
- arg_length=ALIGN_SIZE(arg_length+1);
+ uint32 arg_length= ALIGN_SIZE(length + 1);
+ DBUG_ASSERT(arg_length > length);
+ if (arg_length <= length)
+ return TRUE; /* Overflow */
str_length=0;
if (Alloced_length < arg_length)
{
@@ -56,6 +59,9 @@ bool String::real_alloc(uint32 arg_length)
bool String::realloc(uint32 alloc_length)
{
uint32 len=ALIGN_SIZE(alloc_length+1);
+ DBUG_ASSERT(len > alloc_length);
+ if (len <= alloc_length)
+ return TRUE; /* Overflow */
if (Alloced_length < len)
{
char *new_ptr;