Gentoo Archives: gentoo-commits

From: "Samuli Suominen (ssuominen)" <ssuominen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-client/thunderbird/files: thunderbird-3.1-gcc45.patch
Date: Sat, 26 Jun 2010 15:33:01
Message-Id: 20100626153257.7AB9D2CF7A@corvid.gentoo.org
1 ssuominen 10/06/26 15:32:57
2
3 Added: thunderbird-3.1-gcc45.patch
4 Log:
5 Fix buffer overflow with GCC 4.5 and _U_FORTIFY_SOURCE=2 wrt #324863 by Harald van Dijk.
6 (Portage version: 2.2_rc67/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 mail-client/thunderbird/files/thunderbird-3.1-gcc45.patch
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-client/thunderbird/files/thunderbird-3.1-gcc45.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-client/thunderbird/files/thunderbird-3.1-gcc45.patch?rev=1.1&content-type=text/plain
13
14 Index: thunderbird-3.1-gcc45.patch
15 ===================================================================
16 http://bugs.gentoo.org/324863
17
18 Fix buffer overflow with GCC 4.5 and -U_FORTIFY_SOURCE=2
19
20 Patch by Harald van Dijk
21
22 --- comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hashmgr.cpp
23 +++ comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hashmgr.cpp
24 @@ -187,7 +187,7 @@
25 struct hentry* hp =
26 (struct hentry *) malloc (sizeof(struct hentry) + wbl + descl);
27 if (!hp) return 1;
28 - char * hpw = &(hp->word);
29 + char * hpw = HENTRY_WORD(hp);
30 strcpy(hpw, word);
31 if (ignorechars != NULL) {
32 if (utf8) {
33 --- comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/htypes.hxx
34 +++ comm-1.9.2/mozilla/extensions/spellcheck/hunspell/src/htypes.hxx
35 @@ -57,6 +57,8 @@
36 #ifndef _HTYPES_HXX_
37 #define _HTYPES_HXX_
38
39 +#include <cstddef>
40 +
41 #define ROTATE_LEN 5
42
43 #define ROTATE(v,q) \
44 @@ -68,7 +70,7 @@
45 #define H_OPT_PHON (1 << 2)
46
47 // see also csutil.hxx
48 -#define HENTRY_WORD(h) &(h->word)
49 +#define HENTRY_WORD(h) ((char *) h + offsetof(struct hentry, word))
50
51 // approx. number of user defined words
52 #define USERWORD 1000