fix hanging test - case when mask length is exceeded during determining masked character count