Fix crash caused by invalid sec_status