MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:December 18 2009 7:14pm
Subject:bzr commit into mysql-5.1-bugteam branch (davi:3286) Bug#48983
View as plain text  
# At a local mysql-5.1-bugteam repository of davi

 3286 Davi Arnaut	2009-12-18
      Bug#48983: Bad strmake calls (length one too long)
      
      MySQL 5.1 specific fixes.

    modified:
      server-tools/instance-manager/instance_map.cc
      server-tools/instance-manager/options.cc
      server-tools/instance-manager/user_map.cc
      sql/sql_plugin.cc
=== modified file 'server-tools/instance-manager/instance_map.cc'
--- a/server-tools/instance-manager/instance_map.cc	2009-03-19 13:42:36 +0000
+++ b/server-tools/instance-manager/instance_map.cc	2009-12-18 19:14:09 +0000
@@ -117,13 +117,13 @@ static void parse_option(const char *opt
   while (*ptr == '-')
     ++ptr;
 
-  strmake(option_name_buf, ptr, MAX_OPTION_LEN + 1);
+  strmake(option_name_buf, ptr, MAX_OPTION_LEN);
 
   eq_pos= strchr(ptr, '=');
   if (eq_pos)
   {
     option_name_buf[eq_pos - ptr]= 0;
-    strmake(option_value_buf, eq_pos + 1, MAX_OPTION_LEN + 1);
+    strmake(option_value_buf, eq_pos + 1, MAX_OPTION_LEN);
   }
   else
   {

=== modified file 'server-tools/instance-manager/options.cc'
--- a/server-tools/instance-manager/options.cc	2009-03-19 13:42:36 +0000
+++ b/server-tools/instance-manager/options.cc	2009-12-18 19:14:09 +0000
@@ -533,10 +533,10 @@ static int setup_windows_defaults()
     return 1;
   }
 
-  strmake(base_name, base_name_ptr, FN_REFLEN);
+  strmake(base_name, base_name_ptr, FN_REFLEN - 1);
   *base_name_ptr= 0;
 
-  strmake(im_name, base_name, FN_REFLEN);
+  strmake(im_name, base_name, FN_REFLEN - 1);
   ptr= strrchr(im_name, '.');
 
   if (!ptr)

=== modified file 'server-tools/instance-manager/user_map.cc'
--- a/server-tools/instance-manager/user_map.cc	2009-06-29 14:00:47 +0000
+++ b/server-tools/instance-manager/user_map.cc	2009-12-18 19:14:09 +0000
@@ -25,7 +25,7 @@
 User::User(const LEX_STRING *user_name_arg, const char *password)
 {
   user_length= (uint8) (strmake(user, user_name_arg->str,
-                                USERNAME_LENGTH + 1) - user);
+                                USERNAME_LENGTH) - user);
   set_password(password);
 }
 

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2009-10-27 13:16:02 +0000
+++ b/sql/sql_plugin.cc	2009-12-18 19:14:09 +0000
@@ -2084,7 +2084,7 @@ static int check_func_set(THD *thd, stru
                      &error, &error_len, &not_used);
     if (error_len)
     {
-      strmake(buff, error, min(sizeof(buff), error_len));
+      strmake(buff, error, min(sizeof(buff) - 1, error_len));
       strvalue= buff;
       goto err;
     }


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20091218191409-gdgq8s7ctl6twd01.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (davi:3286) Bug#48983Davi Arnaut18 Dec