From: Date: June 22 2006 12:26pm Subject: bk commit into 5.1 tree (knielsen:1.2211) BUG#20622 List-Archive: http://lists.mysql.com/commits/8062 X-Bug: 20622 Message-Id: Below is the list of changes that have just been committed into a local 5.1 repository of knielsen. When knielsen 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 1.2211 06/06/22 12:26:19 knielsen@stripped +1 -0 BUG#20622: Fix one-byte buffer overrun in IM directory string handling. server-tools/instance-manager/instance_options.cc 1.35 06/06/22 12:26:14 knielsen@stripped +7 -2 Fix buffer overrun. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: knielsen # Host: rt.int.sifira.dk # Root: /usr/local/mysql/mysql-5.1-bug20622 --- 1.34/server-tools/instance-manager/instance_options.cc 2006-05-22 13:20:37 +02:00 +++ 1.35/server-tools/instance-manager/instance_options.cc 2006-06-22 12:26:14 +02:00 @@ -420,8 +420,13 @@ const char *tmp; char *end; - if (!mysqld_path.str && !(mysqld_path.str= strdup_root(&alloc, default_path))) - goto err; + if (!mysqld_path.str) + { + // Note: convert_dirname() assumes the destination is >= FN_REFLEN bytes. + if (!(mysqld_path.str= alloc_root(&alloc, FN_REFLEN))) + goto err; + strmake(mysqld_path.str, default_path, FN_REFLEN-1); + } // it's safe to cast this to char* since this is a buffer we are allocating end= convert_dirname((char*)mysqld_path.str, mysqld_path.str, NullS);