Bug #60802 [Asn->Csd]: ibase_trans() gives segfault when passing params
| From: | mariuz@php.net | Date: | Fri, 20 Jan 2012 20:36:20 +0000 |
| Subject: | Bug #60802 [Asn->Csd]: ibase_trans() gives segfault when passing params | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-166659@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60802&edit=1
ID: 60802
Updated by: mariuz@php.net
Reported by: lars dot westermann at privat dot dk
Summary: ibase_trans() gives segfault when passing params
-Status: Assigned
+Status: Closed
Type: Bug
Package: InterBase related
Operating System: Linux
PHP Version: 5.3.9
Assigned To: mariuz
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2012-01-19 22:31:18] mariuz@php.net
I saw that difference from 5.4 and now i know what was :)
I will merge back patch and 5.3 will look the same like in 5.2 , and 5.4
------------------------------------------------------------------------
[2012-01-19 22:25:54] mariuz@php.net
Automatic comment from SVN on behalf of mariuz
Revision: http://svn.php.net/viewvc/?view=revision&revision=322477
Log: Fix #60802 ibase_trans() gives segfault when passing params (The &argn passed to
zend_parse_parameters shall be a pointer to an integer, not to an unsigned short.)
------------------------------------------------------------------------
[2012-01-19 09:48:11] lars dot westermann at privat dot dk
Description:
------------
The ibase_trans() function segfaults when you pass connection-id and/or mode to the function.
After comparing both 5.2.x version of interbase.c and 5.3.x version, I found the solution:
# diff interbase.c interbase-fix.c
1128c1128,1129
< unsigned short i, argn, link_cnt = 0, tpb_len = 0;
---
> unsigned short i, link_cnt = 0, tpb_len = 0;
> int argn;
The &argn passed to zend_parse_parameters shall be a pointer to an integer, not to an unsigned
short.
Test script:
---------------
$DB = ibase_pconnect($DB_name, $DB_user, $DB_pw );
$TR = ibase_trans($DB);
is enough to trigger the error.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60802&edit=1