Verified Commit a95b799f authored by Even Rouault's avatar Even Rouault
Browse files

TIFFFetchNormalTag(): avoid calling memcpy() with a null source pointer and...

TIFFFetchNormalTag(): avoid calling memcpy() with a null source pointer and size of zero (fixes #383)
parent 14756b2c
Pipeline #473385803 passed with stages
in 10 minutes and 45 seconds
......@@ -5091,7 +5091,10 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
_TIFFfree(data);
return(0);
}
_TIFFmemcpy(o,data,(uint32_t)dp->tdir_count);
if (dp->tdir_count > 0 )
{
_TIFFmemcpy(o,data,(uint32_t)dp->tdir_count);
}
o[(uint32_t)dp->tdir_count]=0;
if (data!=0)
_TIFFfree(data);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment