Fixed crash in CheckBufferOverrun on garbage code (#5595)