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
 [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: Sun Apr 28 21:01:29 2024 UTC