com php-src: improve fix #72558, while (u>=0) with unsigned int will always be true: ext/gd/libgd /gd_interpolation.c

From: Date: Thu, 21 Jul 2016 00:16:37 +0000
Subject: com php-src: improve fix #72558, while (u>=0) with unsigned int will always be true: ext/gd/libgd /gd_interpolation.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93278@lists.php.net to get a copy of this message
Commit: 8fa9d1ce28f3a894b104979df30d0b65e0f21107 Author: Pierre Joye <pierre.php@gmail.com> Tue, 19 Jul 2016 15:51:43 +0700 Committer: Ferenc Kovacs <tyra3l@gmail.com> Thu, 21 Jul 2016 02:16:37 +0200 Parents: a41745061b77398663eaa5721a804568f8fc217b Branches: PHP-5.6.24 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8fa9d1ce28f3a894b104979df30d0b65e0f21107 Log: improve fix #72558, while (u>=0) with unsigned int will always be true Bugs: https://bugs.php.net/72558 Changed paths: M ext/gd/libgd/gd_interpolation.c Diff: diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 9481e3f..9a7789e 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -904,11 +904,12 @@ static inline LineContribType * _gdContributionsAlloc(unsigned int line_length, res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double)); } if (overflow_error == 1 || res->ContribRow[u].Weights == NULL) { + unsigned int i; u--; - while (u >= 0) { - gdFree(res->ContribRow[u].Weights); - u--; + for (i=0;i<=u;i++) { + gdFree(res->ContribRow[i].Weights); } + gdFree(res); return NULL; } }

« previous php.cvs (#93278) next »