php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52686 mysql_stmt_attr_[gs]et arg. points to incorrect type
Submitted: 2010-08-24 13:37 UTC Modified: 2010-10-13 12:12 UTC
From: rein at basefarm dot no Assigned: mysql (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.3.3 OS: Solaris10 on sparc
Private report: No CVE-ID: None
 [2010-08-24 13:37 UTC] rein at basefarm dot no
Description:
------------
The 3. argument to mysql_stmt_attr_[gs]et() should be a pointer to my_bool or ulong depending on the value of its 2. arg. :-(  As of now the code always pass pointers to either my_bool or ulong, causing a bus error or incorrect value to be retrieved on a big-endian system like solaris/sparc.

A patch that fixes and tests this problem is coming.  Using the patch, the ext/mysqli/tests/mysqli_stmt_attr_[gs]et.phpt tests succeed for me on solaris10/sparc, solaris10/x86_64 and redhat4/x86_64, without it they fail on solaris10/sparc.

Btw, tested using mysql 5.1.35.  According to the mysql doc. the argument changed from an uint* to a my_bool* in mysql 5.1.7.



Patches

rein-mysql_fetch_hash (last revision 2010-08-24 11:39 UTC by rein at basefarm dot no)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-24 13:42 UTC] rein at basefarm dot no
Btw, bad patch name (browser remembered form content), correct content..
 [2010-08-25 15:12 UTC] uw@php.net
-Assigned To: +Assigned To: mysql
 [2010-10-06 13:11 UTC] andrey@php.net
Automatic comment from SVN on behalf of andrey
Revision: http://svn.php.net/viewvc/?view=revision&revision=304146
Log: Fix for Bug #52686  	mysql_stmt_attr_[gs]et arg. points to incorrect type
 [2010-10-13 12:12 UTC] andrey@php.net
-Status: Assigned +Status: Closed
 [2010-10-13 12:12 UTC] andrey@php.net
fix is in 5.3.4
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC