com php-src: Port gdImageSetStyle() overflow check from libgd 2.0.29: ext/gd/libgd/gd.c

From: Date: Mon, 19 Sep 2016 14:56:07 +0000
Subject: com php-src: Port gdImageSetStyle() overflow check from libgd 2.0.29: ext/gd/libgd/gd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94590@lists.php.net to get a copy of this message
Commit: 77ba2483d95ec12a8ec4c12ccd0453827f8d3fb8 Author: Christoph M. Becker <cmbecker69@gmx.de> Mon, 19 Sep 2016 16:49:06 +0200 Parents: 6f7479251bb4e5466fc77e8e8ad01d3c1d85f02e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=77ba2483d95ec12a8ec4c12ccd0453827f8d3fb8 Log: Port gdImageSetStyle() overflow check from libgd 2.0.29 Changed paths: M ext/gd/libgd/gd.c Diff: diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 57c0aea..7a0af8d 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -2789,6 +2789,9 @@ void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels) if (im->style) { gdFree(im->style); } + if (overflow2(sizeof (int), noOfPixels)) { + return; + } im->style = (int *) gdMalloc(sizeof(int) * noOfPixels); memcpy(im->style, style, sizeof(int) * noOfPixels); im->styleLength = noOfPixels;

« previous php.cvs (#94590) next »