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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Mon Apr 29 02:01:29 2024 UTC