From: Cristy Date: Tue, 18 Jun 2019 15:57:54 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/1602 X-Git-Tag: 7.0.8-50~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe5f4b85e6b1b54d3b4588a77133c06ade46d891;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1602 --- diff --git a/coders/tiff.c b/coders/tiff.c index 7efbb970b..97402f2cb 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -258,6 +258,12 @@ static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset, } case SEEK_CUR: { + if (((offset > 0) && (profile->offset > (SSIZE_MAX-offset))) || + ((offset < 0) && (profile->offset < (-SSIZE_MAX-offset)))) + { + errno=EOVERFLOW; + return(-1); + } if ((profile->offset+offset) < 0) return(-1); profile->offset+=offset;