openbsd-ports/graphics/tiff/patches/patch-libtiff_tif_compress_c
naddy 5cab5c465d Major update to 4.0.1, which adds BigTIFF support and includes some API
changes.  Also include upstream fix for CVE-2012-1173.
2012-04-14 15:09:55 +00:00

22 lines
880 B
Plaintext

$OpenBSD: patch-libtiff_tif_compress_c,v 1.4 2012/04/14 15:09:55 naddy Exp $
--- libtiff/tif_compress.c.orig Wed Apr 11 18:23:56 2012
+++ libtiff/tif_compress.c Wed Apr 11 18:25:07 2012
@@ -201,14 +201,15 @@ TIFFFindCODEC(uint16 scheme)
TIFFCodec*
TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init)
{
+ size_t namelen = strlen(name);
codec_t* cd = (codec_t*)
- _TIFFmalloc((tmsize_t)(sizeof (codec_t) + sizeof (TIFFCodec) + strlen(name)+1));
+ _TIFFmalloc((tmsize_t)(sizeof (codec_t) + sizeof (TIFFCodec) + namelen+1));
if (cd != NULL) {
cd->info = (TIFFCodec*) ((uint8*) cd + sizeof (codec_t));
cd->info->name = (char*)
((uint8*) cd->info + sizeof (TIFFCodec));
- strcpy(cd->info->name, name);
+ strlcpy(cd->info->name, name, namelen+1);
cd->info->scheme = scheme;
cd->info->init = init;
cd->next = registeredCODECS;