From 7c5a40b00df87008f5a94b6572028d3863b0cb8e Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Sat, 24 Oct 2020 07:54:59 +0200 Subject: [PATCH] Fix for CONC-510: CoreDump using set env MARIADB_PLUGIN_DIR The macro CLEAR_CLIENT_ERROR needs to check if mysql->net.extension was already allocated to prevent access of uninitialized memory. --- include/mysql.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mysql.h b/include/mysql.h index 32e2d896..5174e07a 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -148,7 +148,8 @@ extern const char *SQLSTATE_UNKNOWN; (a)->net.last_errno= 0;\ strcpy((a)->net.sqlstate, "00000");\ (a)->net.last_error[0]= '\0';\ - (a)->net.extension->extended_errno= 0;\ + if ((a)->net.extension)\ + (a)->net.extension->extended_errno= 0;\ } while (0) #define MYSQL_COUNT_ERROR (~(unsigned long long) 0)