openbsd-ports/graphics/tiff/patches/patch-libtiff_tif_extension_c
2022-03-11 19:22:04 +00:00

24 lines
872 B
Plaintext

Index: libtiff/tif_extension.c
--- libtiff/tif_extension.c.orig
+++ libtiff/tif_extension.c
@@ -79,6 +79,7 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const c
{
TIFFClientInfoLink *psLink = tif->tif_clientinfo;
+ size_t namelen = strlen(name);
/*
** Do we have an existing link with this name? If so, just
@@ -100,9 +101,9 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const c
psLink = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
assert (psLink != NULL);
psLink->next = tif->tif_clientinfo;
- psLink->name = (char *) _TIFFmalloc((tmsize_t)(strlen(name)+1));
+ psLink->name = (char *) _TIFFmalloc((tmsize_t)(namelen+1));
assert (psLink->name != NULL);
- strcpy(psLink->name, name);
+ strlcpy(psLink->name, name, namelen+1);
psLink->data = data;
tif->tif_clientinfo = psLink;