Bug #79263 [Opn]: finfo_buffer fails with "PHP Fatal error: Allowed memory size of"

From: Date: Thu, 13 Feb 2020 08:15:27 +0000
Subject: Bug #79263 [Opn]: finfo_buffer fails with "PHP Fatal error: Allowed memory size of"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225552@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79263&edit=1 ID: 79263 Updated by: nikic@php.net Reported by: anestis at fraganestis dot eu Summary: finfo_buffer fails with "PHP Fatal error: Allowed memory size of" Status: Open Type: Bug Package: Unknown/Other Function Operating System: Debian 9 PHP Version: 7.4.2 Block user comment: N Private report: N New Comment: This sounds similar to bug #78987. In any case, this is a bug in upstream libmagic, it needs to be reported and fixed there before we can do anything about it. Previous Comments: ------------------------------------------------------------------------ [2020-02-13 05:15:01] anestis at fraganestis dot eu @requinix@php.net: It's a pdf file. Seems legit. The reader (foxit) opens it just fine. ------------------------------------------------------------------------ [2020-02-13 05:11:07] anestis at fraganestis dot eu @requinix@php.net: just over 17M (17318320 bytes). ------------------------------------------------------------------------ [2020-02-13 00:47:18] requinix@php.net @bugreports: Passing strings around does not allocate new memory because of copy-on-write. ------------------------------------------------------------------------ [2020-02-13 00:46:16] requinix@php.net @anestis: How large is $buffer, and are its contents valid (not corrupted) for the file type? ------------------------------------------------------------------------ [2020-02-12 23:55:51] bugreports at gmail dot com or don't pass around whole files in strings which allocates memory often two or even three times $h = finfo_open(); $mime_type = finfo_file($h, $path, FILEINFO_MIME_TYPE); finfo_close($h); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=79263 -- Edit this bug report at https://bugs.php.net/bug.php?id=79263&edit=1

« previous php.bugs (#225552) next »