summaryrefslogtreecommitdiff
path: root/sql/mdl.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-02-28 18:42:49 +0100
committerSergei Golubchik <sergii@pisem.net>2013-02-28 18:42:49 +0100
commit8161c6772d144d6a4f08fc924ff6e6e403d1371d (patch)
tree3f1fe5f8048a163da4eadf0f86c1fd2a3007955d /sql/mdl.h
parent154aac8eb002f5d167153e09f1d13570989521e0 (diff)
parent31c06437c970d4d0f4ec0301acac9c56e0ed29b5 (diff)
downloadmariadb-git-8161c6772d144d6a4f08fc924ff6e6e403d1371d.tar.gz
merge with mysql-5.5.30 minus few incorrect or not applicable changesets
Diffstat (limited to 'sql/mdl.h')
-rw-r--r--sql/mdl.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/mdl.h b/sql/mdl.h
index af7d75c1297..68f24a7a0e8 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -242,8 +242,14 @@ public:
const char *db, const char *name)
{
m_ptr[0]= (char) mdl_namespace;
- m_db_name_length= (uint16) (strmov(m_ptr + 1, db) - m_ptr - 1);
- m_length= (uint16) (strmov(m_ptr + m_db_name_length + 2, name) - m_ptr + 1);
+ /*
+ It is responsibility of caller to ensure that db and object names
+ are not longer than NAME_LEN. Still we play safe and try to avoid
+ buffer overruns.
+ */
+ m_db_name_length= (uint16) (strmake(m_ptr + 1, db, NAME_LEN) - m_ptr - 1);
+ m_length= (uint16) (strmake(m_ptr + m_db_name_length + 2, name, NAME_LEN) -
+ m_ptr + 1);
}
void mdl_key_init(const MDL_key *rhs)
{