1 |
ssuominen 12/01/08 18:53:52 |
2 |
|
3 |
Added: stardict-3.0.3-compositelookup_cpp.patch |
4 |
stardict-3.0.3-overflow.patch |
5 |
Log: |
6 |
Incorporate OpenSUSE patches for buffer overflows and startup crash. |
7 |
|
8 |
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 app-text/stardict/files/stardict-3.0.3-compositelookup_cpp.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/stardict/files/stardict-3.0.3-compositelookup_cpp.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/stardict/files/stardict-3.0.3-compositelookup_cpp.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: stardict-3.0.3-compositelookup_cpp.patch |
17 |
=================================================================== |
18 |
This patch is from OpenSUSE .src.rpm for the following crash on startup: |
19 |
|
20 |
ERROR:compositelookup.cpp:53:void CompositeLookup::send_net_dict_request(const string&, const string&): assertion failed: (NetDictRequests.end() == std::find(NetDictRequests.begin(), NetDictRequests.end(), request)) |
21 |
|
22 |
--- dict/src/lib/compositelookup.cpp |
23 |
+++ dict/src/lib/compositelookup.cpp |
24 |
@@ -50,8 +50,10 @@ |
25 |
void CompositeLookup::send_net_dict_request(const std::string& dict_id, const std::string& key) |
26 |
{ |
27 |
NetDictRequest request(dict_id, key); |
28 |
- g_assert(NetDictRequests.end() == std::find(NetDictRequests.begin(), NetDictRequests.end(), request)); |
29 |
- NetDictRequests.push_back(request); |
30 |
+ if(NetDictRequests.end() == std::find(NetDictRequests.begin(), NetDictRequests.end(), request)) |
31 |
+ { |
32 |
+ NetDictRequests.push_back(request); |
33 |
+ } |
34 |
} |
35 |
|
36 |
/* returns true if got expected response */ |
37 |
|
38 |
|
39 |
|
40 |
1.1 app-text/stardict/files/stardict-3.0.3-overflow.patch |
41 |
|
42 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/stardict/files/stardict-3.0.3-overflow.patch?rev=1.1&view=markup |
43 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-text/stardict/files/stardict-3.0.3-overflow.patch?rev=1.1&content-type=text/plain |
44 |
|
45 |
Index: stardict-3.0.3-overflow.patch |
46 |
=================================================================== |
47 |
This patch is stardict-tools-3.0.3-destbufferoverflow.patch from OpenSUSE .src.rpm for: |
48 |
|
49 |
warning: call to ‘__fgets_chk_warn’ declared with attribute warning: fgets called with bigger size than length of destination buffer [enabled by default] |
50 |
|
51 |
--- tools/src/myspell2dic.c |
52 |
+++ tools/src/myspell2dic.c |
53 |
@@ -132,7 +132,7 @@ if (argc<3) |
54 |
|
55 |
fprintf(stderr, "Enter grammar language [Spanish]: "); |
56 |
fflush(stderr); |
57 |
-fgets(lang, 100, stdin); |
58 |
+fgets(lang, 50, stdin); |
59 |
if ((p=strchr(lang, '\n'))!=NULL) *p=0; |
60 |
if (*lang==0) strcpy(lang, "Spanish"); |
61 |
|
62 |
--- tools/src/ooo2dict.c |
63 |
+++ tools/src/ooo2dict.c |
64 |
@@ -71,7 +71,7 @@ current2=malloc(10000); |
65 |
|
66 |
fprintf(stderr, "Enter thesaurus language [WordNet_English]: "); |
67 |
fflush(stderr); |
68 |
-fgets(lang, 100, stdin); |
69 |
+fgets(lang, 50, stdin); |
70 |
if ((p=strchr(lang, '\n'))!=NULL) *p=0; |
71 |
if (*lang==0) strcpy(lang, "WordNet_English"); |
72 |
F=fopen((argc>1)? argv[1]: "/usr/share/myspell/dicts/th_en_US_v2.dat", "rt"); |