Fix the global-buffer-overflow in tiffset
fixing the global-buffer-overflow bug in tiffset, which is described in #355 (closed).
Merge request reports
Activity
Thanks, it was fixed in 0a827a98.
The call
TIFFSetField(tiff, TIFFFieldTag(fip),(uint16_t)len, argv[arg_index])
expects aslen
a uint32_t parameter for ASCII tags with passcount=true. This works for TIFFSetField() because of va_arg variable promotion, but would not work for TIFFGetField(). Hence, the cast of theuint32_t len
to(uint16_t)len
is superfluous.By the way, for handling of unknown (anonymous) tags see the discussion at #353 (closed).
In this case, the read/write interface for TIFFSetField() and TIFFGetField() for an unknown TIFF_ASCII tag is defined by the _TIFFCreateAnonField() function as TIFF_SETGET_C32_ASCII.
Actually, simple ASCII tags with variable character length are defined with the interface as TIFF_SETGET_ASCII.
TIFF_SETGET_C16_ASCII or TIFF_SETGET_C32_ASCII is used for string arrays, such as at the TIFFTAG_INKNAMES tag.
- Resolved by 4ugustus
- Resolved by 4ugustus
- Resolved by 4ugustus
- Resolved by 4ugustus
mentioned in commit 49396659