]> granicus.if.org Git - php/commit
Fix #79283: Segfault in libmagic patch contains a buffer overflow
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 2 Mar 2020 14:26:59 +0000 (15:26 +0100)
committerStanislav Malyshev <stas@php.net>
Tue, 17 Mar 2020 05:42:15 +0000 (22:42 -0700)
commit7702b693b5a40af433797cbbe80f7f9f504a468a
tree13e26acc0136cac6ba020e513b3d82ef1f886c73
parentebdaeb85728dde9530d2be50307e03e389bae3a9
Fix #79283: Segfault in libmagic patch contains a buffer overflow

To solve this, we properly calculate the required string length upfront
instead of allocating an oversized string (`len * 4 + 4`).
ext/fileinfo/libmagic.patch
ext/fileinfo/libmagic/softmagic.c
ext/fileinfo/tests/bug79283.phpt [new file with mode: 0644]