Skip to content

Commit

Permalink
add extra check
Browse files Browse the repository at this point in the history
For out of mem confition
  • Loading branch information
mm2 committed Jul 14, 2018
1 parent 9a75047 commit c2a1cd9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmscgats.c
Expand Up @@ -2314,6 +2314,11 @@ cmsHANDLE CMSEXPORT cmsIT8LoadFromMem(cmsContext ContextID, const void *Ptr, cm

it8 = (cmsIT8*) hIT8;
it8 ->MemoryBlock = (char*) _cmsMalloc(ContextID, len + 1);
if (it8->MemoryBlock == NULL)
{
cmsIT8Free(hIT8);
return FALSE;
}

strncpy(it8 ->MemoryBlock, (const char*) Ptr, len);
it8 ->MemoryBlock[len] = 0;
Expand Down

0 comments on commit c2a1cd9

Please sign in to comment.