File tiff-CVE-2023-3576.patch of Package tiff.34105
Index: tiff-4.0.9/tools/tiffcrop.c
===================================================================
--- tiff-4.0.9.orig/tools/tiffcrop.c
+++ tiff-4.0.9/tools/tiffcrop.c
@@ -7761,8 +7761,13 @@ createCroppedImage(struct image_data *im
read_buff = *read_buff_ptr;
+ /* Memory is freed before crop_buff_ptr is overwritten */
+ if (*crop_buff_ptr != NULL)
+ {
+ _TIFFfree(*crop_buff_ptr);
+ }
+
/* process full image, no crop buffer needed */
- crop_buff = read_buff;
*crop_buff_ptr = read_buff;
crop->combined_width = image->width;
crop->combined_length = image->length;