1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fixed segfault:

Use rpl->host and port instead of mysql->options.
This commit is contained in:
Georg Richter
2023-02-22 11:32:21 +01:00
parent 9890d34612
commit dbb4d8d93b
2 changed files with 14 additions and 3 deletions

View File

@@ -763,13 +763,13 @@ int STDCALL mariadb_rpl_open(MARIADB_RPL *rpl)
4 source server id (unused)
*/
unsigned char *p, buffer[1024];
size_t len= MIN(strlen(rpl->mysql->options.extension->rpl_host), 255);
size_t len= MIN(strlen(rpl->host), 255);
p= buffer;
int4store(p, rpl->server_id);
p+= 4;
*p++= (unsigned char)len;
memcpy(p, rpl->mysql->options.extension->rpl_host, len);
memcpy(p, rpl->host, len);
p+= len;
/* Don't send user, password, rank and server_id */