From 4c1065522d19c04b4e89ee2370b9419a7b7181c7 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Thu, 3 Dec 2009 09:43:26 +0000 Subject: [PATCH] fix segfault introduced by Pierre in a recent commit old code was doing something like conn + sizeof(MYSQLND) * MYSQLND + plugin * sizeof(void) * sizeof(MYSQLND) because `conn` is not casted to void*. `conn` has to be casted to void * and then the whole experession will be void * and the calculations will work. --- ext/mysqlnd/mysqlnd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 3d4b02677a..365068d60c 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2393,7 +2393,7 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, if (!conn || plugin_id >= mysqlnd_plugin_count()) { return NULL; } - DBG_RETURN((void *)(conn + sizeof(MYSQLND) + plugin_id * sizeof(void *))); + DBG_RETURN((void *)conn + sizeof(MYSQLND) + plugin_id * sizeof(void *)); } /* }}} */ -- 2.40.0