From: Andrey Hristov Date: Thu, 3 Dec 2009 09:43:26 +0000 (+0000) Subject: fix segfault introduced by Pierre in a recent commit X-Git-Tag: php-5.4.0alpha1~191^2~2310 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4c1065522d19c04b4e89ee2370b9419a7b7181c7;p=php 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. --- 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 *)); } /* }}} */