diff options
author | Michael Stahl <mst@openoffice.org> | 2012-08-02 12:10:01 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-08-02 15:38:29 +0200 |
commit | dac29877d1c92aa55215165976ca87d6a50f6698 (patch) | |
tree | cfad1c68c6a5f580f0d0c032a9468cff185cf223 /mythes | |
parent | 0be83d670946c6e03a5f8e4fa78c695bc08d6a13 (diff) |
mythes: fix some warnings
Signed-off-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'mythes')
-rw-r--r-- | mythes/makefile.mk | 1 | ||||
-rw-r--r-- | mythes/mythes-1.2.2-overflow.patch | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/mythes/makefile.mk b/mythes/makefile.mk index 44f8ba9d6582..41770ffd0ab0 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.2-overflow.patch \ mythes-1.2.0-makefile-mk.diff \ mythes-1.2.0-android.patch diff --git a/mythes/mythes-1.2.2-overflow.patch b/mythes/mythes-1.2.2-overflow.patch new file mode 100644 index 000000000000..13dee8b858ac --- /dev/null +++ b/mythes/mythes-1.2.2-overflow.patch @@ -0,0 +1,24 @@ +--- misc/mythes-1.2.2/mythes.cxx 2010-02-27 16:52:52.000000000 +0100 ++++ misc/build/mythes-1.2.2/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); |