summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2007-12-17 09:16:47 +0100
committerunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2007-12-17 09:16:47 +0100
commitba0506676b52f2ced84c5064f5358c57ba0ba603 (patch)
tree4501d7a748c3148dabe656360170ab39f6a95794
parent5ce7cdbe54667610f3ab1acf849985d637472e1d (diff)
parent02cdb7eccab6fe262d4a9d430f9d23eb51ac4839 (diff)
downloadmariadb-git-ba0506676b52f2ced84c5064f5358c57ba0ba603.tar.gz
Merge mysql.com:/misc/mysql/31752_/50-31752_
into mysql.com:/misc/mysql/31752_/51-31752_ mysys/mf_pack.c: Auto merged sql/log.cc: Auto merged sql/sql_show.cc: Auto merged sql/unireg.cc: Auto merged
-rw-r--r--mysys/mf_pack.c4
-rw-r--r--sql/log.cc2
-rw-r--r--sql/unireg.cc5
3 files changed, 8 insertions, 3 deletions
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index a31b9595c85..63525e4d927 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -282,7 +282,7 @@ void symdirget(char *dir)
SYNOPSIS
unpack_dirname()
- to Store result here. May be = from
+ to result-buffer, FN_REFLEN characters. may be == from
from 'Packed' directory name (may contain ~)
IMPLEMENTATION
@@ -408,7 +408,7 @@ size_t unpack_filename(char * to, const char *from)
/* Convert filename (unix standard) to system standard */
/* Used before system command's like open(), create() .. */
- /* Returns length of to */
+ /* Returns used length of to; total length should be FN_REFLEN */
size_t system_filename(char * to, const char *from)
{
diff --git a/sql/log.cc b/sql/log.cc
index 500c66bd892..1789b56014c 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2998,7 +2998,7 @@ err:
void MYSQL_BIN_LOG::make_log_name(char* buf, const char* log_ident)
{
uint dir_len = dirname_length(log_file_name);
- if (dir_len > FN_REFLEN)
+ if (dir_len >= FN_REFLEN)
dir_len=FN_REFLEN-1;
strnmov(buf, log_file_name, dir_len);
strmake(buf+dir_len, log_ident, FN_REFLEN - dir_len -1);
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 8f2d10d4e2a..3ef1e4576e1 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -228,6 +228,11 @@ bool mysql_create_frm(THD *thd, const char *file_name,
create_info->comment.str : "", create_info->comment.length);
forminfo[46]=(uchar) create_info->comment.length;
#ifdef EXTRA_DEBUG
+ /*
+ EXTRA_DEBUG causes strmake() to initialize its buffer behind the
+ payload with a magic value to detect wrong buffer-sizes. We
+ explicitly zero that segment again.
+ */
memset((char*) forminfo+47 + forminfo[46], 0, 61 - forminfo[46]);
#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE