summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-06-18 02:48:01 +0300
committerunknown <monty@mysql.com>2004-06-18 02:48:01 +0300
commit8764abf237a1a50646af9e7ee03ab82c6c635423 (patch)
tree57f9df83c4faa772ce66f366b687ce65194d944b /libmysql
parent2871477d5db8969d01490421c28b71eedd9804a8 (diff)
parentb57fe1e26ae91b660c0d8665bb6e9e3f9e154076 (diff)
downloadmariadb-git-8764abf237a1a50646af9e7ee03ab82c6c635423.tar.gz
Merge mysql.com:/home/my/mysql-3.23 into mysql.com:/home/my/mysql-4.0
libmysql/libmysql.c: Auto merged
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index b3624ef3e94..e3e896615d5 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -1863,7 +1863,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno);
goto error;
}
- memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
+ memcpy(&sock_addr.sin_addr, hp->h_addr,
+ min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length));
my_gethostbyname_r_free();
}
sock_addr.sin_port = (ushort) htons((ushort) port);