spamprobe crashes when parsing jpeg mime attachment
Brought to you by:
bburton
The attached testmail will crash spamprobe when trying to train it:
$ spamprobe good testmail
caught signal 11: quitting
Aborted (core dumped)
The problem seems to be caused by illegal C++ code where no return statement is used. I used g++ 9.3.0 as compiler.
In this special case I had to add the "return true" in this location:
bool JpegParser::parseImage()
{
try {
initializeSource();
digestImage();
tokenizeImage();
return true;
} catch (std::exception const &) {
return false;
}
}
With this fix in place the file can be proccessed.
There are a number of more places where such a return is missing. I created the attached file spamprobe.patch against the debian package of version 1.4d to fix these issues.
This fixes spamprobe crashes on Ubuntu 22.04 as well.