mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Fix for BUG#4017 "mysql_real_connect buffer overflow"
This commit is contained in:
parent
2e04da0873
commit
69bea44bc9
1 changed files with 2 additions and 1 deletions
|
@ -1358,7 +1358,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
|||
my_gethostbyname_r_free();
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue