fix Issue 11965 - Segfault on garbage