|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-03-23 18:06 UTC] lester at lsces dot co dot uk
[2021-03-31 11:38 UTC] cmb@php.net
-Status: Open
+Status: Suspended
[2021-03-31 11:38 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ The ibase_affected_rows function has one optional parameter which it's a resource link to a Interbase/Firebird database. If we pass a non-resource link to this function it generates a Segmentation Fault Test script: --------------- // Bad parameter in ibase_affected_rows $conx = ibase_connect($bd_file, $bd_user, $bd_pass, 'NONE'); $sql = 'UPDATE some_table SET some_field = ? WHERE some_id = xx'; $prep = ibase_prepare( $sql ); $query = ibase_execute( $prep, $field_value); if (ibase_affected_rows($query) != 1) ) { echo "ok" } else { echo "error"; } // Correct way $conx = ibase_connect($bd_file, $bd_user, $bd_pass, 'NONE'); $sql = 'UPDATE some_table SET some_field = ? WHERE some_id = xx'; $prep = ibase_prepare( $sql ); $query = ibase_execute( $prep, $field_value); if (ibase_affected_rows($conx) != 1) ) { echo "ok" } else { echo "error"; } Expected result: ---------------- PHP should check if the passed variable it's a resource link, and in case it's not, it should generate one error, instead of a segmentation fault which gives no information to the developer for fix the problem.