Skip to content

Commit 3e408ac

Browse files
author
Anushree Prakash B
committed
Merge branch 'mysql-5.6' into mysql-5.7
2 parents 3f4b658 + 6d86d29 commit 3e408ac

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

sql/hostname.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,15 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
549549
}
550550
);
551551

552+
553+
DBUG_EXECUTE_IF ("getnameinfo_fake_max_length",
554+
{
555+
std::string s(NI_MAXHOST-1, 'a');
556+
strcpy(hostname_buffer, s.c_str());
557+
err_code= 0;
558+
}
559+
);
560+
552561
/*
553562
===========================================================================
554563
DEBUG code only (end)

storage/perfschema/pfs.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
#include "pfs_program.h"
5959
#include "pfs_prepared_stmt.h"
6060

61+
using std::min;
62+
6163
/*
6264
This is a development tool to investigate memory statistics,
6365
do not use in production.
@@ -2379,8 +2381,8 @@ void pfs_set_thread_account_v1(const char *user, int user_len,
23792381
DBUG_ASSERT((uint) user_len <= sizeof(pfs->m_username));
23802382
DBUG_ASSERT((host != NULL) || (host_len == 0));
23812383
DBUG_ASSERT(host_len >= 0);
2382-
DBUG_ASSERT((uint) host_len <= sizeof(pfs->m_hostname));
23832384

2385+
host_len= min<size_t>(host_len, sizeof(pfs->m_hostname));
23842386
if (unlikely(pfs == NULL))
23852387
return;
23862388

0 commit comments

Comments
 (0)