diff options
author | Michael Stahl <mst@openoffice.org> | 2012-07-31 16:03:16 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-07-31 16:03:16 +0200 |
commit | d5a2e5efd3b2e47051121a7bb31c6eb2c29cfeec (patch) | |
tree | 523be246678f371b77df0644481ed33597a0a070 | |
parent | ab7c7b89c700bad9a3a87bc5e07a637cc2922bdf (diff) |
mythes: fix some warnings
Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | mythes/makefile.mk | 1 | ||||
-rw-r--r-- | mythes/mythes-1.2.0-overflow.patch | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/mythes/makefile.mk b/mythes/makefile.mk index c66307769602..305559da0ee5 100644 --- a/mythes/makefile.mk +++ b/mythes/makefile.mk @@ -43,6 +43,7 @@ ADDITIONAL_FILES += makefile.mk PATCH_FILES=\ mythes-1.2.0-vanilla-th-gen-idx.patch \ + mythes-1.2.0-overflow.patch \ mythes-1.2.0-makefile-mk.diff \ mythes-1.2.1-rhbz675806.patch \ mythes-1.2.0-android.patch diff --git a/mythes/mythes-1.2.0-overflow.patch b/mythes/mythes-1.2.0-overflow.patch new file mode 100644 index 000000000000..d69433762bea --- /dev/null +++ b/mythes/mythes-1.2.0-overflow.patch @@ -0,0 +1,24 @@ +--- misc/mythes-1.2.0/mythes.cxx 2010-02-27 16:52:52.000000000 +0100 ++++ misc/build/mythes-1.2.0/mythes.cxx 2011-05-18 16:22:49.125014204 +0200 +@@ -4,6 +4,8 @@ + #include <stdlib.h> + #include <errno.h> + ++#include <limits> ++ + #include "mythes.hxx" + + // some basic utility routines +@@ -204,6 +206,12 @@ + return 0; + } + int nmeanings = atoi(buf+np+1); ++ if ((nmeanings < 0) || ++ ((::std::numeric_limits<size_t>::max() / sizeof(mentry)) < nmeanings)) ++ { ++ free(buf); ++ return 0; ++ } + *pme = (mentry*) malloc( nmeanings * sizeof(mentry) ); + if (!(*pme)) { + free(buf); |