|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-21 08:50 UTC] wez@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 04:00:01 2025 UTC |
Description: ------------ file ext/standard/file.c line 1028 buf = ecalloc(len + 1, sizeof(char)); if (php_stream_get_line(stream, buf, len, &line_len) == NULL) { goto exit_failed; } here doesn't check the availablity of 'buf', so if ecalloc doesn't calloc a memory, it will return NULL, it will cause some problem Reproduce code: --------------- $fp=fopen("1.txt", "r"); fgets($fp, 2147483640); on some platform, when ecalloc failed, it will return NULL, so segmentation fault will prompt. the same as fread function