patch-libtiff_tif_extension_c 969 B

123456789101112131415161718192021222324
  1. $OpenBSD: patch-libtiff_tif_extension_c,v 1.5 2016/11/29 20:00:35 naddy Exp $
  2. --- libtiff/tif_extension.c.orig Wed Apr 11 18:27:24 2012
  3. +++ libtiff/tif_extension.c Wed Apr 11 18:28:53 2012
  4. @@ -81,6 +81,7 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const c
  5. {
  6. TIFFClientInfoLink *psLink = tif->tif_clientinfo;
  7. + size_t namelen = strlen(name);
  8. /*
  9. ** Do we have an existing link with this name? If so, just
  10. @@ -102,9 +103,9 @@ void TIFFSetClientInfo( TIFF *tif, void *data, const c
  11. psLink = (TIFFClientInfoLink *) _TIFFmalloc(sizeof(TIFFClientInfoLink));
  12. assert (psLink != NULL);
  13. psLink->next = tif->tif_clientinfo;
  14. - psLink->name = (char *) _TIFFmalloc((tmsize_t)(strlen(name)+1));
  15. + psLink->name = (char *) _TIFFmalloc((tmsize_t)(namelen+1));
  16. assert (psLink->name != NULL);
  17. - strcpy(psLink->name, name);
  18. + strlcpy(psLink->name, name, namelen+1);
  19. psLink->data = data;
  20. tif->tif_clientinfo = psLink;