From 7868bca437431f95f4b51afa3e4c4b64e45ebad9 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Fri, 26 Mar 2010 16:58:25 +0000 Subject: Fix tests that fail when the MySQL's socket file is not /tmp/mysql.sock as it is in when compiled from source and the default for mysqlnd. SuSE for example uses /var/run/mysql/mysql.sock . Also, sql.safe_mode (ext/mysql and ingres) needs the socket. Fix possible crashes in mysqlnd. When packets are shorter, functions should return error. --- ext/mysqlnd/mysqlnd_result.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/mysqlnd/mysqlnd_result.c') diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index ac3761868b..224b590d54 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -470,7 +470,7 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT * s TSRMLS_DC) if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) { /* For PS, we leave them in Prepared state */ - if (!stmt) { + if (!stmt && conn->current_result) { mnd_efree(conn->current_result); conn->current_result = NULL; } -- cgit v1.2.1