openbsd-ports/graphics/tiff/patches/patch-libtiff_tif_extension_c
naddy 12aaddf055 SECURITY:
Update to 3.9.4, which includes fixes for CVE-2009-2347 and CVE-2010-1411.
2010-06-30 17:10:07 +00:00

24 lines
923 B
Plaintext

$OpenBSD: patch-libtiff_tif_extension_c,v 1.3 2010/06/30 17:10:08 naddy Exp $
--- libtiff/tif_extension.c.orig Sun Jun 27 01:06:26 2010
+++ libtiff/tif_extension.c Sun Jun 27 01:08:54 2010
@@ -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(strlen(name)+1);
+ link->name = (char *) _TIFFmalloc(namelen+1);
assert (link->name != NULL);
- strcpy(link->name, name);
+ strlcpy(link->name, name, namelen+1);
link->data = data;
tif->tif_clientinfo = link;