patch for possible static memory corruption on large edit entity messages