com php-src: Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf: NEWS ext/gd/libgd/gd_io_dp.c
| From: | Christoph Michael Becker | Date: | Thu, 13 Oct 2016 09:10:02 +0000 |
| Subject: | com php-src: Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf: NEWS ext/gd/libgd/gd_io_dp.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95019@lists.php.net to get a copy of this message | ||
Commit: cc08cbc84d46933c1e9e0149633f1ed5d19e45e9
Author: Christoph M. Becker <cmbecker69@gmx.de> Thu, 13 Oct 2016 11:10:02 +0200
Parents: 43ccf23d700ae780451e257f5a66d4210f82f026
Branches: PHP-5.6 PHP-7..0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc08cbc84d46933c1e9e0149633f1ed5d19e45e9
Log:
Fix #73280: Stack Buffer Overflow in GD dynamicGetbuf
We make sure to never pass a negative
rlen as size to memcpy().
Cf. <https://github.com/libgd/libgd/commit/53110871>.
Bugs:
https://bugs.php.net/73280
Changed paths:
M NEWS
M ext/gd/libgd/gd_io_dp.c
Diff:
diff --git a/NEWS b/NEWS
index d9e6b4c..4150504 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PHP NEWS
. Fixed bug #73272 (imagescale() is not affected by, but affects
imagesetinterpolation()). (cmb)
. Fixed bug #73279 (Integer overflow in gdImageScaleBilinearPalette()). (cmb)
+ . Fixed bug #73280 (Stack Buffer Overflow in GD dynamicGetbuf). (cmb)
- SOAP:
. Fixed bug #73037 (SoapServer reports Bad Request when gzipped). (Anatol)
diff --git a/ext/gd/libgd/gd_io_dp.c b/ext/gd/libgd/gd_io_dp.c
index bfeb4cb..4dcedde 100644
--- a/ext/gd/libgd/gd_io_dp.c
+++ b/ext/gd/libgd/gd_io_dp.c
@@ -237,7 +237,7 @@ static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len)
if (remain >= len) {
rlen = len;
} else {
- if (remain == 0) {
+ if (remain <= 0) {
return EOF;
}
rlen = remain;