php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60802 ibase_trans() gives segfault when passing params
Submitted: 2012-01-19 09:48 UTC Modified: 2012-01-20 20:36 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: lars dot westermann at privat dot dk Assigned: mariuz (profile)
Status: Closed Package: InterBase related
PHP Version: 5.3.9 OS: Linux
Private report: No CVE-ID: None
 [2012-01-19 09:48 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-19 18:59 UTC] mariuz@php.net
-Assigned To: +Assigned To: mariuz
 [2012-01-19 22:25 UTC] mariuz@php.net
Automatic comment from SVN on behalf of mariuz
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=322477
Log: Fix #60802 ibase_trans() gives segfault when passing params (The &amp;argn passed to zend_parse_parameters shall be a pointer to an integer, not to an unsigned short.)
 [2012-01-19 22:31 UTC] 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-20 20:36 UTC] mariuz@php.net
-Status: Assigned +Status: Closed
 [2012-01-20 20:36 UTC] mariuz@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC