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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sqchen at citiz dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2026 The PHP Group
All rights reserved.
Last updated: Thu May 07 13:00:01 2026 UTC