Don't crash on certain invalid memory read/write commands

This commit is contained in:
Ilari Liusvaara 2014-01-02 03:04:03 +02:00
parent ba08f9a792
commit 848a0eef1e

View file

@ -124,6 +124,10 @@ namespace
void invoke(const std::string& args) throw(std::bad_alloc, std::runtime_error)
{
regex_results t = regex("(([^ \t]+)([ \t]+([^ \t]+)([ \t]+([^ \t].*)?)?)?)?", args);
if(!t) {
address_bad = true;
return;
}
firstword = t[2];
secondword = t[4];
has_tail = (t[6] != "");