Skip to content
Snippets Groups Projects
Commit 49396659 authored by Even Rouault's avatar Even Rouault
Browse files

Merge branch 'master' into 'master'

Fix the global-buffer-overflow in tiffset

See merge request !287
parents 707178a7 03047a26
No related branches found
No related tags found
1 merge request!287Fix the global-buffer-overflow in tiffset
Pipeline #456046602 passed
......@@ -146,9 +146,19 @@ main(int argc, char* argv[])
arg_index++;
if (TIFFFieldDataType(fip) == TIFF_ASCII) {
if (TIFFSetField(tiff, TIFFFieldTag(fip), argv[arg_index]) != 1)
fprintf( stderr, "Failed to set %s=%s\n",
TIFFFieldName(fip), argv[arg_index] );
if(TIFFFieldPassCount( fip )) {
size_t len;
len = strlen(argv[arg_index]) + 1;
if (len > UINT16_MAX || TIFFSetField(tiff, TIFFFieldTag(fip),
(uint16_t)len, argv[arg_index]) != 1)
fprintf( stderr, "Failed to set %s=%s\n",
TIFFFieldName(fip), argv[arg_index] );
} else {
if (TIFFSetField(tiff, TIFFFieldTag(fip),
argv[arg_index]) != 1)
fprintf( stderr, "Failed to set %s=%s\n",
TIFFFieldName(fip), argv[arg_index] );
}
} else if (TIFFFieldWriteCount(fip) > 0
|| TIFFFieldWriteCount(fip) == TIFF_VARIABLE) {
int ret = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment