altf4 / untwister

Seed recovery tool for PRNGs
GNU General Public License v3.0
359 stars 42 forks source link

Crashes on empty lines #49

Open FalcoGer opened 2 years ago

FalcoGer commented 2 years ago

When given an input file with an empty line, the application crashes with an uncaught exception.

$ echo "1\n2\n3\n" > crash.txt
$ untwister -i crash.txt
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 0) >= this->size() (which is 0)
[1]    1160017 IOT instruction (core dumped)  untwister -i crash.txt
$ echo "1\n\n2\n3\n4" > crash2.txt
$ untwister -i crash2.txt
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 0) >= this->size() (which is 0)
[1]    1160344 IOT instruction (core dumped)  untwister -i crash2.txt