php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43196 array_intersect_assoc() generates segmentation fault with non-array input(s)
Submitted: 2007-11-05 12:53 UTC Modified: 2007-11-06 14:45 UTC
From: kraghuba at in dot ibm dot com Assigned:
Status: Closed Package: Arrays related
PHP Version: 5.3CVS-2007-11-05 (snap) OS: Linux, windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
36 + 14 = ?
Subscribe to this entry?

 
 [2007-11-05 12:53 UTC] kraghuba at in dot ibm dot com
Description:
------------
array_intersect_assoc() generates segmentation fault when any of its argument is given as non array. There is no warning message issued indicating that an array should be passed. 

This problem is noticed with the drivers after 18th Oct 2007.

Applicable to php5.2, php5.3 and php6.


Reproduce code:
---------------
<?php
$arr = array(1, 2, 3, 4);
$val = 1234;
var_dump( array_intersect_assoc($arr, $val) );
?>

Expected result:
----------------
Warning: array_intersect(): Argument #2 is not an array in %s on line %d
NULL

Actual result:
--------------
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-06 13:02 UTC] jani@php.net
Fix underway.
 [2007-11-06 13:33 UTC] jani@php.net
Fixed in CVS. I think the same bug was with array_diff_assoc() as well. But I fixed that too. (no test for it yet?)
 [2007-11-06 14:45 UTC] kraghuba at in dot ibm dot com
thanks Jani. Tests for array_diff_assoc() is going to be there soon.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Sep 28 13:03:38 2021 UTC