diff options
author | Andrey Hristov <andrey@php.net> | 2009-12-03 09:43:26 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2009-12-03 09:43:26 +0000 |
commit | bfc0ec18910052d5e88bf1badcefff017bde8b65 (patch) | |
tree | 988c0967a55c753cdb1c9bfb657ff394baea20da /ext/mysqlnd/mysqlnd.c | |
parent | 28d53f87529cfec93263ba727c12bb9572b1beac (diff) | |
download | php-git-bfc0ec18910052d5e88bf1badcefff017bde8b65.tar.gz |
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.
Diffstat (limited to 'ext/mysqlnd/mysqlnd.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 *)); } /* }}} */ |