Exploit databaseDownload repository ZIP
GH-4e14e821fe70fe602c844dd60509c614
dandanllab/php-5.6.40-cve-2026-109618-109619
Sources for CVE-2026-109618
413 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files68
dandanllab/php-5.6.40-cve-2026-109618-109619Revision 6f241e8c620e
- ↑..Parent directory
- COPYING
- README
- gd.c
- gd.h
- gd2copypal.c
- gd2time.c
- gd2topng.c
- gd_arc.c
- gd_arc_f_buggy.c
- gd_color.c
- gd_crop.c
- gd_filter.c
- gd_gd.c
- gd_gd2.c
- gd_gif_in.c
- gd_gif_out.c
- gd_intern.h
- gd_interpolation.c
- gd_io.c
- gd_io.h
- gd_io_dp.c
- gd_io_file.c
- gd_io_ss.c
- gd_jpeg.c
- gd_matrix.c
- gd_pixelate.c
- gd_png.c
- gd_rotate.c
- gd_security.c
- gd_ss.c
- gd_topal.c
- gd_transform.c
- gd_wbmp.c
- gd_webp.c
- gdcache.c
- gdcache.h
- gddemo.c
- gdfontg.c
- gdfontg.h
- gdfontl.c
- gdfontl.h
- gdfontmb.c
- gdfontmb.h
- gdfonts.c
- gdfonts.h
- gdfontt.c
- gdfontt.h
- gdft.c
- gdhelpers.c
- gdhelpers.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
php-5.6.40/ext/gd/libgd/gd_color.c
C · 1,536 bytes#if HAVE_GD_BUNDLED
# include "gd.h"
# include "gdhelpers.h"
#else
# include <gd.h>
# include "libgd/gdhelpers.h"
#endif
#include "gd_intern.h"
#include "php.h"
/* bring the palette colors in im2 to be closer to im1
*
*/
int gdImageColorMatch (gdImagePtr im1, gdImagePtr im2)
{
unsigned long *buf; /* stores our calculations */
unsigned long *bp; /* buf ptr */
int color, rgb;
int x,y;
int count;
if( !im1->trueColor ) {
return -1; /* im1 must be True Color */
}
if( im2->trueColor ) {
return -2; /* im2 must be indexed */
}
if( (im1->sx != im2->sx) || (im1->sy != im2->sy) ) {
return -3; /* the images are meant to be the same dimensions */
}
if (im2->colorsTotal<1) {
return -4; /* At least 1 color must be allocated */
}
buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * gdMaxColors, 0);
memset( buf, 0, sizeof(unsigned long) * 5 * gdMaxColors );
for (x=0; x<im1->sx; x++) {
for( y=0; y<im1->sy; y++ ) {
color = im2->pixels[y][x];
rgb = im1->tpixels[y][x];
bp = buf + (color * 5);
(*(bp++))++;
*(bp++) += gdTrueColorGetRed(rgb);
*(bp++) += gdTrueColorGetGreen(rgb);
*(bp++) += gdTrueColorGetBlue(rgb);
*(bp++) += gdTrueColorGetAlpha(rgb);
}
}
bp = buf;
for (color=0; color<im2->colorsTotal; color++) {
count = *(bp++);
if( count > 0 ) {
im2->red[color] = *(bp++) / count;
im2->green[color] = *(bp++) / count;
im2->blue[color] = *(bp++) / count;
im2->alpha[color] = *(bp++) / count;
} else {
bp += 4;
}
}
gdFree(buf);
return 0;
}