From 570bfb0de69e5f5e9b36786377087fba5e3f2585 Mon Sep 17 00:00:00 2001 From: Arnold Robbins Date: Thu, 23 Feb 2017 12:03:58 +0200 Subject: [PATCH] Fix core dump if no connection attributes available. Reported in https://github.com/mcafee/mysql-audit/issues/161. --- include/audit_handler.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/audit_handler.h b/include/audit_handler.h index c615776..1d35a63 100644 --- a/include/audit_handler.h +++ b/include/audit_handler.h @@ -392,7 +392,13 @@ public: //no offsets - return null return NULL; } - return *(const char **) (((unsigned char *) pfs) + Audit_formatter::thd_offsets.pfs_connect_attrs); + const char **pfs_pointer = (const char **) (((unsigned char *) pfs) + Audit_formatter::thd_offsets.pfs_connect_attrs); + if (pfs_pointer == NULL) + { + return NULL; + } + + return *pfs_pointer; } static inline uint pfs_connect_attrs_length(void * pfs)