add protection against truncated events + coverity - Rachid