1--- misc/mythes-1.2.0/mythes.cxx	2010-02-27 16:52:52.000000000 +0100
2+++ misc/build/mythes-1.2.0/mythes.cxx	2011-05-18 16:22:49.125014204 +0200
3@@ -4,6 +4,8 @@
4 #include <stdlib.h>
5 #include <errno.h>
6
7+#include <limits>
8+
9 #include "mythes.hxx"
10
11 // some basic utility routines
12@@ -204,6 +206,12 @@
13          return 0;
14     }
15     int nmeanings = atoi(buf+np+1);
16+    if ((nmeanings < 0) ||
17+        ((::std::numeric_limits<size_t>::max() / sizeof(mentry)) < nmeanings))
18+    {
19+        free(buf);
20+        return 0;
21+    }
22     *pme = (mentry*) malloc( nmeanings * sizeof(mentry) );
23     if (!(*pme)) {
24         free(buf);
25