24 Commits

Author SHA1 Message Date
Mike Frysinger
19c7a5d651 use gdIOCtxPtr more consistently
We have gdIOCtxPtr for gdIOCtx*, so switch the public headers to it
consistently.
2021-05-28 21:19:20 -04:00
Iman Hosseini
3ad4e65075 Fixed typo in the comments.
Fixed typo "As will all ..." -> "As with all ..."
2019-05-06 10:36:53 +02:00
Christoph M. Becker
880c9f6def Back-port fix for PHP bug 75111
Although libgd is not really affected by this issue, because contrary
to PHP's bundled libgd it does not allow to read from negative offsets,
we consider it still a bug that `dynamicSeek()` does not behave like
`fileSeek()` with regard to negative positions.

As this behavior cannot be probed from outside, we omit the regression
test.
2017-08-24 14:32:20 +02:00
Christoph M. Becker
55ac28a293 Fix #357: 2.2.4: Segfault in test suite.
We make sure to never pass a negative `int` as argument to a `size_t`
parameter.
2017-01-19 01:02:58 +01:00
Christoph M. Becker
4859d69e07 Fix invalid read in gdImageCreateFromTiffPtr()
tiff_invalid_read.tiff is corrupt, and causes an invalid read in
gdImageCreateFromTiffPtr(), but not in gdImageCreateFromTiff(). The culprit
is dynamicGetbuf(), which doesn't check for out-of-bound reads. In this case,
dynamicGetbuf() is called with a negative dp->pos, but also positive buffer
overflows have to be handled, in which case 0 has to be returned (cf. commit
75e29a9).

Fixing dynamicGetbuf() exhibits that the corrupt TIFF would still create
the image, because the return value of TIFFReadRGBAImage() is not checked.
We do that, and let createFromTiffRgba() fail if TIFFReadRGBAImage() fails.

This issue had been reported by Ibrahim El-Sayed to security@libgd.org.

CVE-2016-6911
2016-12-13 13:55:48 +01:00
Christoph M. Becker
5311087193 Avoid potentially dangerous signed to unsigned conversion
We make sure to never pass a negative `rlen` as size to memcpy(). See
also <https://bugs.php.net/bug.php?id=73280>.

Patch provided by Emmanuel Law.
2016-10-12 11:15:32 +02:00
Christoph M. Becker
b0333689ef Document all BGD_DECLARE'd functions
We add only minimal documentation comments for now, but at least that lets
Natural Docs add the function prototypes to the documentation.
2016-07-20 21:24:48 +02:00
pierrejoye
e20413bf6b - apply same CS everywhere 2013-04-03 14:23:11 +02:00
tabe
a9aefdb14c Fixed FS#196 2009-04-04 12:00:37 +00:00
mattias
4b3804e683 - According to the standard, the '#' char must be at column 0 (Thanks Nuno) 2007-10-28 23:09:09 +00:00
mattias
493f11ec08 - ws + cs 2007-10-28 22:04:36 +00:00
pajoye
75e29a997c #33, dynamicGetbuf must return 0 for errors and EOF 2007-01-03 21:47:09 +00:00
pierre
5742a4107e - sync to 2.0.29 2006-04-05 15:54:20 +00:00
pierre
f7a1a94acb - sync to 2.0.24 2006-04-05 15:52:22 +00:00
pierre
0a3439a3e7 - sync to 2.0.23 2006-04-05 15:51:53 +00:00
pierre
06e39b1bf5 - sync to 2.0.21 2006-04-05 15:50:59 +00:00
pierre
2399023b6c - sync to 2.0.9 2006-04-05 15:46:42 +00:00
pierre
b0243fe7b1 - sync to 2.0.5 2006-04-05 15:44:56 +00:00
pierre
b623f93e30 - sync to 2.0.4 2006-04-05 15:44:17 +00:00
pierre
1cdea7482e - sync to 2.0.1 2006-04-05 15:42:56 +00:00
pierre
22d55c5aa4 - sync to 1.8.4 2006-04-05 15:41:55 +00:00
pierre
0b986ddde7 - sync to 1.7.0 2006-04-05 15:38:05 +00:00
pierre
6223ff8d81 - sync to 1.6.2 2006-04-05 15:37:05 +00:00
pierre
084ba37adc - sync to 1.6.0 2006-04-05 15:35:53 +00:00