openbsd-ports/graphics/tiff/patches/patch-libtiff_tif_extension_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

24 lines
947 B
Plaintext

$OpenBSD: patch-libtiff_tif_extension_c,v 1.4 2012/04/14 15:09:55 naddy Exp $
--- libtiff/tif_extension.c.orig Wed Apr 11 18:27:24 2012
+++ libtiff/tif_extension.c Wed Apr 11 18:28:53 2012
@@ -81,6 +81,7 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const c
{
TIFFClientInfoLink *link = tif->tif_clientinfo;
+ size_t namelen = strlen(name);
/*
** Do we have an existing link with this name? If so, just
@@ -102,9 +103,9 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const c
link = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
assert (link != NULL);
link->next = tif->tif_clientinfo;
- link->name = (char *) _TIFFmalloc((tmsize_t)(strlen(name)+1));
+ link->name = (char *) _TIFFmalloc((tmsize_t)(namelen+1));
assert (link->name != NULL);
- strcpy(link->name, name);
+ strlcpy(link->name, name, namelen+1);
link->data = data;
tif->tif_clientinfo = link;