From 1a30a8064fb9b8218a13796347b77c654e839dce Mon Sep 17 00:00:00 2001 From: Catena cyber <35799796+catenacyber@users.noreply.github.com> Date: Sun, 22 Dec 2019 00:40:26 +0100 Subject: [PATCH] [mysql] Fix misalign in mysql fuzz target (#3160) --- projects/mysql-server/targets/fuzz_real_query.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/mysql-server/targets/fuzz_real_query.cc b/projects/mysql-server/targets/fuzz_real_query.cc index 15a72e763..913b01b90 100644 --- a/projects/mysql-server/targets/fuzz_real_query.cc +++ b/projects/mysql-server/targets/fuzz_real_query.cc @@ -24,7 +24,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { if (logfile == NULL) { logfile = fopen("/dev/null", "w"); } - flags = * ((unsigned long *) (Data + Size - sizeof(unsigned long))); + memcpy(&flags, Data + Size - sizeof(unsigned long), sizeof(unsigned long)); mysql_init(&mysql); mysql_options(&mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, &opt_cleartext); mysql_options(&mysql, MYSQL_OPT_SSL_MODE, &opt_ssl);