php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36508 fgetcsv($fp, 2147483647) will cause segfault
Submitted: 2006-02-24 10:08 UTC Modified: 2006-02-24 10:31 UTC
From: sqchen at citiz dot net Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.1.2 OS: redhat 7.3
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:
2 + 16 = ?
Subscribe to this entry?

 
 [2006-02-24 10:08 UTC] sqchen at citiz dot net
Description:
------------
fgetcsv($fp, 2147483647) will cause segfault, this behavior is same as fgets ......

Reproduce code:
---------------
<?php
$fp =fopen("1.txt", "r");
fgetcsv($fp, 2147483647);
?>

Actual result:
--------------
FATAL:  emalloc():  Unable to allocate -2147483648 bytes
Segmentation fault


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-24 10:31 UTC] tony2001@php.net
This segfault is expected if PHP has been built with --enable-debug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 14 04:01:30 2024 UTC