taku910 / crfpp

CRF++: Yet Another CRF toolkit
Other
505 stars 192 forks source link

Fix crash in tagger when next() is called before parse() #52

Open brandon-fry opened 3 years ago

brandon-fry commented 3 years ago

Adds a null pointer check to the agenda member in next before accessing it. Normally, agenda is allocated when parse is called, so the call to next will only seg fault if it is called before parse. For cases of empty input from a user, parse may not get called, but next should return false in this case without crashing.