summaryrefslogtreecommitdiff
path: root/hunspell
diff options
context:
space:
mode:
authorCaolán McNamara <cmc@openoffice.org>2010-03-04 10:44:57 +0000
committerCaolán McNamara <cmc@openoffice.org>2010-03-04 10:44:57 +0000
commit3cab002be02f884327950e09375106bba6a760d9 (patch)
treec16ca014cc273a50a93117186900e9b9f9d6c8eb /hunspell
parentea42b264c09ef14aaf5a71fb3baeb31b108bcaa2 (diff)
hunspell129: #i107768# fix stack smash
Diffstat (limited to 'hunspell')
-rw-r--r--hunspell/hunspell-stacksmash.patch28
-rw-r--r--hunspell/makefile.mk3
2 files changed, 30 insertions, 1 deletions
diff --git a/hunspell/hunspell-stacksmash.patch b/hunspell/hunspell-stacksmash.patch
new file mode 100644
index 000000000000..8765b6d784d3
--- /dev/null
+++ b/hunspell/hunspell-stacksmash.patch
@@ -0,0 +1,28 @@
+--- misc/hunspell-1.2.9/src/hunspell/hunspell.cxx 2010-03-04 10:25:06.000000000 +0000
++++ misc/build/hunspell-1.2.9/src/hunspell/hunspell.cxx 2010-03-04 10:25:38.000000000 +0000
+@@ -1665,7 +1665,7 @@
+ if (!q2) return 0; // bad XML input
+ if (check_xml_par(q, "type=", "analyze")) {
+ int n = 0, s = 0;
+- if (get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN)) n = analyze(slst, cw);
++ if (get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1)) n = analyze(slst, cw);
+ if (n == 0) return 0;
+ // convert the result to <code><a>ana1</a><a>ana2</a></code> format
+ for (int i = 0; i < n; i++) s+= strlen((*slst)[i]);
+@@ -1686,13 +1686,13 @@
+ (*slst)[0] = r;
+ return 1;
+ } else if (check_xml_par(q, "type=", "stem")) {
+- if (get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN)) return stem(slst, cw);
++ if (get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1)) return stem(slst, cw);
+ } else if (check_xml_par(q, "type=", "generate")) {
+- int n = get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN);
++ int n = get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1);
+ if (n == 0) return 0;
+ char * q3 = strstr(q2 + 1, "<word");
+ if (q3) {
+- if (get_xml_par(cw2, strchr(q3, '>'), MAXWORDUTF8LEN)) {
++ if (get_xml_par(cw2, strchr(q3, '>'), MAXWORDUTF8LEN - 1)) {
+ return generate(slst, cw, cw2);
+ }
+ } else {
diff --git a/hunspell/makefile.mk b/hunspell/makefile.mk
index 64e35afdfb3e..819f0e6cee00 100644
--- a/hunspell/makefile.mk
+++ b/hunspell/makefile.mk
@@ -42,7 +42,8 @@ ADDITIONAL_FILES+=config.h
PATCH_FILES=\
hunspell-wntconfig.patch \
- hunspell-solaris.patch
+ hunspell-solaris.patch \
+ hunspell-stacksmash.patch
.IF "$(GUI)"=="UNX"