List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:November 26 2007 7:43am
Subject:bk commit into 4.1 tree (tnurnberg:1.2699) BUG#32707
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of tnurnberg. When tnurnberg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-11-26 08:43:30+01:00, tnurnberg@stripped +1 -0
  Bug#32707: misdimensioned buffer in protocol layer
  
  miscalculation in protocol-layer: when appending to buffer,
  need to use remaining bytes rather than total bytes as limit

  sql/protocol.cc@stripped, 2007-11-26 08:43:29+01:00, tnurnberg@stripped +4 -1
    When appending to buffer, limit to remaining size, not
    total size.

diff -Nrup a/sql/protocol.cc b/sql/protocol.cc
--- a/sql/protocol.cc	2006-11-13 11:28:50 +01:00
+++ b/sql/protocol.cc	2007-11-26 08:43:29 +01:00
@@ -112,7 +112,10 @@ void send_error(THD *thd, uint sql_errno
       buff[2]= '#';
       pos= strmov(buff+3, mysql_errno_to_sqlstate(sql_errno));
     }
-    length= (uint) (strmake(pos, err, MYSQL_ERRMSG_SIZE-1) - buff);
+    /*
+      deduct already used space, -1 for terminating \0, +2 from definition.
+    */
+    length= (uint) (strmake(pos, err, MYSQL_ERRMSG_SIZE - (pos - buff) +1) - buff);
     err=buff;
   }
   else
Thread
bk commit into 4.1 tree (tnurnberg:1.2699) BUG#32707Tatjana A Nuernberg26 Nov