Exploit databaseDownload repository ZIP
GH-68a106f50640b22c0bb32b6b806a797e
ahallais/php82-ubuntu2404-backport
Sources for CVE-2026-109618
412 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files67
ahallais/php82-ubuntu2404-backportRevision 7995f69c237f
- ↑..Parent directory
- bmp.h
- gd.c
- gd.h
- gd2copypal.c
- gd2time.c
- gd2topng.c
- gd_avif.c
- gd_bmp.c
- gd_color_match.c
- gd_crop.c
- gd_errors.h
- 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_tga.c
- gd_tga.h
- gd_topal.c
- gd_transform.c
- gd_wbmp.c
- gd_webp.c
- gd_xbm.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
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
sury/build/php8.2-8.2.35/ext/gd/libgd/gd_io.c
C · 3,470 bytes
/*
* io.c
*
* Implements the simple I/O 'helper' routines.
*
* Not really essential, but these routines were used extensively in GD,
* so they were moved here. They also make IOCtx calls look better...
*
* Written (or, at least, moved) 1999, Philip Warner.
*
*/
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "gd.h"
/* Use this for commenting out debug-print statements. */
/* Just use the first '#define' to allow all the prints... */
/*#define IO_DBG(s) (s) */
#define IO_DBG(s)
#define GD_IO_EOF_CHK(r) \
if (r == EOF) { \
return 0; \
} \
/*
* Write out a word to the I/O context pointer
*/
void Putword (int w, gdIOCtx * ctx)
{
unsigned char buf[2];
buf[0] = w & 0xff;
buf[1] = (w / 256) & 0xff;
(ctx->putBuf) (ctx, (char *) buf, 2);
}
void Putchar (int c, gdIOCtx * ctx)
{
(ctx->putC) (ctx, c & 0xff);
}
void gdPutC (const unsigned char c, gdIOCtx * ctx)
{
(ctx->putC) (ctx, c);
}
void gdPutWord (int w, gdIOCtx * ctx)
{
IO_DBG (gd_error("Putting word..."));
(ctx->putC) (ctx, (unsigned char) (w >> 8));
(ctx->putC) (ctx, (unsigned char) (w & 0xFF));
IO_DBG (gd_error("put."));
}
void gdPutInt (int w, gdIOCtx * ctx)
{
IO_DBG (gd_error("Putting int..."));
(ctx->putC) (ctx, (unsigned char) (w >> 24));
(ctx->putC) (ctx, (unsigned char) ((w >> 16) & 0xFF));
(ctx->putC) (ctx, (unsigned char) ((w >> 8) & 0xFF));
(ctx->putC) (ctx, (unsigned char) (w & 0xFF));
IO_DBG (gd_error("put."));
}
int gdGetC (gdIOCtx * ctx)
{
return ((ctx->getC) (ctx));
}
int gdGetByte (int *result, gdIOCtx * ctx)
{
int r;
r = (ctx->getC) (ctx);
GD_IO_EOF_CHK(r);
*result = r;
return 1;
}
int gdGetWord (int *result, gdIOCtx * ctx)
{
int r;
r = (ctx->getC) (ctx);
GD_IO_EOF_CHK(r);
*result = r << 8;
r = (ctx->getC) (ctx);
GD_IO_EOF_CHK(r);
*result += r;
return 1;
}
int gdGetWordLSB(signed short int *result, gdIOCtx *ctx)
{
int high = 0, low = 0;
low = (ctx->getC) (ctx);
if (low == EOF) {
return 0;
}
high = (ctx->getC) (ctx);
if (high == EOF) {
return 0;
}
if (result) {
*result = (high << 8) | low;
}
return 1;
}
int gdGetInt (int *result, gdIOCtx * ctx)
{
unsigned int r;
r = (ctx->getC) (ctx);
GD_IO_EOF_CHK(r);
*result = r << 24;
r = (ctx->getC) (ctx);
GD_IO_EOF_CHK(r);
*result += r << 16;
r = (ctx->getC) (ctx);
if (r == EOF) {
return 0;
}
*result += r << 8;
r = (ctx->getC) (ctx);
GD_IO_EOF_CHK(r);
*result += r;
return 1;
}
int gdGetIntLSB(signed int *result, gdIOCtx *ctx)
{
unsigned int c;
unsigned int r = 0;
c = (ctx->getC) (ctx);
if (c == EOF) {
return 0;
}
r |= (c << 24);
r >>= 8;
c = (ctx->getC) (ctx);
if (c == EOF) {
return 0;
}
r |= (c << 24);
r >>= 8;
c = (ctx->getC) (ctx);
if (c == EOF) {
return 0;
}
r |= (c << 24);
r >>= 8;
c = (ctx->getC) (ctx);
if (c == EOF) {
return 0;
}
r |= (c << 24);
if (result) {
*result = (signed int)r;
}
return 1;
}
int gdPutBuf (const void *buf, int size, gdIOCtx * ctx)
{
IO_DBG (gd_error("Putting buf..."));
return (ctx->putBuf) (ctx, buf, size);
IO_DBG (gd_error("put."));
}
int gdGetBuf (void *buf, int size, gdIOCtx * ctx)
{
return (ctx->getBuf) (ctx, buf, size);
}
int gdSeek (gdIOCtx * ctx, const int pos)
{
IO_DBG (gd_error("Seeking..."));
return ((ctx->seek) (ctx, pos));
IO_DBG (gd_error("Done."));
}
long gdTell (gdIOCtx * ctx)
{
IO_DBG (gd_error("Telling..."));
return ((ctx->tell) (ctx));
IO_DBG (gd_error ("told."));
}