remove dead vulnerable code in ext_gd.cpp
commitd79ed9332c3518774e514845addce6442e51721b
authorJán <jjergus@fb.com>
Mon, 20 Apr 2020 19:21:55 +0000 (20 12:21 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 20 Apr 2020 19:28:48 +0000 (20 12:28 -0700)
tree5b11e6a014d41dcdd6f08b5ebfd2ff6b3f3e17a9
parentc8abf142e7154e9c98e8d123e6a16da009d25574
remove dead vulnerable code in ext_gd.cpp

Summary:
Based on PHP Fix bug #78256 (heap-buffer-overflow on exif_process_user_comment), which doesn't affect HHVM because this code is dead.

EXIF_USE_MBSTRING is never defined so this is dead code (it doesn't even compile when I tried forcing EXIF_USE_MBSTRING = 1). Given that the dead code contains a potential vulnerability (CVE 2019-11042), it's probably safer to delete it completely and not risk someone enabling it later.

I kept the test case from https://bugs.php.net/bug.php?id=78256 even though no fix was necessary, to prevent potential regressions in the future.

Reviewed By: alexeyt

Differential Revision: D19898317

fbshipit-source-id: 292a74bc818518d18d824fb8c08bbd9eed6b2c0f
hphp/runtime/ext/gd/ext_gd.cpp
hphp/test/slow/ext_gd/bug-78256.jpeg [new file with mode: 0644]
hphp/test/slow/ext_gd/bug-78256.php [new file with mode: 0644]
hphp/test/slow/ext_gd/bug-78256.php.expectf [new file with mode: 0644]
hphp/test/slow/ext_gd/bug-78256.php.skipif [new file with mode: 0644]