php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62300 Wrong NULL checks
Submitted: 2012-06-12 13:00 UTC Modified: 2017-10-24 06:45 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: qiyuhua at 126 dot com Assigned:
Status: Open Package: InterBase related
PHP Version: 5.4.3 OS: ubuntu 10.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-06-12 13:00 UTC] qiyuhua at 126 dot com
Description:
------------
As described in https://bugs.php.net/bug.php?id=54426, Wrong NULL checks was found. However, we find that the bug is not well repaired. And we can still reproduce the bug.
Removing the "continue" statement in the block of Null check code in ibase_query.c should be make everything work well:

Modified: php/php-src/trunk/ext/interbase/ibase_query.c
===================================================================
679c679
< 				continue;
---
> 				//continue;
===================================================================


Test script:
---------------
The two simple test scripts can be available at https://sourceforge.net/projects/wautorepair/files/test%20cases/
1)create a table like "createtable.php";
2)insert a NULL value like "huahua.php"

then, some errors will occur.


Patches

patch-for-wrong-null (last revision 2012-06-16 03:08 UTC) by qiyuhua at 126 dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-12 23:23 UTC] felipe@php.net
Please, send a unified diff next time. Thanks.
 [2012-06-16 03:13 UTC] qiyuhua at 126 dot com
I have updated the patch file.
Test to reproduce the bug :
1.Create a table with not null field 
2.Add trigger filling this field before insert 
3.Try from PHP insert null value in the way of "ibase_query($dbh, "insert into hua values (3,?)",null)", which is the key for the reproduction. And if we insert null value in the way of "ibase_query($dbh, "insert into hua values (3,null)")", there is no error.
 [2014-04-08 11:50 UTC] mariuz@php.net
-Assigned To: +Assigned To: mariuz
 [2017-10-24 06:45 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: mariuz +Assigned To:
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Jun 18 13:02:00 2018 UTC