diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index 977da096..68af6485 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -4078,7 +4078,7 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...) (uint)strlen((char *)key)))) { p+= strlen(key) + 1; - *((void **)data)= *((void **)p); + memcpy(data, p, sizeof(void *)); break; } if (data) diff --git a/plugins/auth/my_auth.c b/plugins/auth/my_auth.c index 83f6fa52..545ff303 100644 --- a/plugins/auth/my_auth.c +++ b/plugins/auth/my_auth.c @@ -7,7 +7,7 @@ #include typedef struct st_mysql_client_plugin_AUTHENTICATION auth_plugin_t; -static int client_mpvio_write_packet(struct st_plugin_vio*, const uchar*, size_t); +static int client_mpvio_write_packet(struct st_plugin_vio*, const uchar*, int); static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); static int native_password_hash(MYSQL *mysql, unsigned char *out, size_t *outlen); static int dummy_fallback_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql __attribute__((unused))); @@ -22,7 +22,7 @@ extern const char *disabled_plugins; typedef struct { int (*read_packet)(struct st_plugin_vio *vio, uchar **buf); - int (*write_packet)(struct st_plugin_vio *vio, const uchar *pkt, size_t pkt_len); + int (*write_packet)(struct st_plugin_vio *vio, const uchar *pkt, int pkt_len); void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); /* -= end of MYSQL_PLUGIN_VIO =- */ MYSQL *mysql; @@ -600,7 +600,7 @@ static int client_mpvio_read_packet(struct st_plugin_vio *mpv, uchar **buf) */ static int client_mpvio_write_packet(struct st_plugin_vio *mpv, - const uchar *pkt, size_t pkt_len) + const uchar *pkt, int pkt_len) { int res; MCPVIO_EXT *mpvio= (MCPVIO_EXT*)mpv; @@ -608,9 +608,9 @@ static int client_mpvio_write_packet(struct st_plugin_vio *mpv, if (mpvio->packets_written == 0) { if (mpvio->mysql_change_user) - res= send_change_user_packet(mpvio, pkt, (int)pkt_len); + res= send_change_user_packet(mpvio, pkt, pkt_len); else - res= send_client_reply_packet(mpvio, pkt, (int)pkt_len); + res= send_client_reply_packet(mpvio, pkt, pkt_len); } else {