diff --git a/CVE-2019-17544.patch b/CVE-2019-17544.patch deleted file mode 100644 index 69f3045817df1f3879843bdd0b92e72b783520ba..0000000000000000000000000000000000000000 --- a/CVE-2019-17544.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 80fa26c74279fced8d778351cff19d1d8f44fe4e Mon Sep 17 00:00:00 2001 -From: Kevin Atkinson -Date: Sun, 4 Aug 2019 04:20:29 -0400 -Subject: [PATCH] Fix various bugs found by OSS-Fuze. - ---- - common/config.cpp | 2 +- - common/file_util.cpp | 1 + - common/getdata.cpp | 2 +- - 3 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/common/config.cpp b/common/config.cpp -index 017e741..e117d3c 100644 ---- a/common/config.cpp -+++ b/common/config.cpp -@@ -763,7 +763,7 @@ namespace acommon { - } - res.append(':'); - } -- if (res.back() == ':') res.pop_back(); -+ if (!res.empty() && res.back() == ':') res.pop_back(); - } - - struct ListAddHelper : public AddableContainer -diff --git a/common/file_util.cpp b/common/file_util.cpp -index 8515832..56ea501 100644 ---- a/common/file_util.cpp -+++ b/common/file_util.cpp -@@ -181,6 +181,7 @@ namespace acommon { - while ( (dir = els.next()) != 0 ) - { - path = dir; -+ if (path.empty()) continue; - if (path.back() != '/') path += '/'; - unsigned dir_len = path.size(); - path += filename; -diff --git a/common/getdata.cpp b/common/getdata.cpp -index 7e822c9..1b04823 100644 ---- a/common/getdata.cpp -+++ b/common/getdata.cpp -@@ -64,7 +64,7 @@ namespace acommon { - char * unescape(char * dest, const char * src) - { - while (*src) { -- if (*src == '\\') { -+ if (*src == '\\' && src[1]) { - ++src; - switch (*src) { - case 'n': *dest = '\n'; break; diff --git a/CVE-2019-20433-1.patch b/CVE-2019-20433-1.patch deleted file mode 100644 index e4d47555a1e473815c7b5af2f0a805203ce46a51..0000000000000000000000000000000000000000 --- a/CVE-2019-20433-1.patch +++ /dev/null @@ -1,1207 +0,0 @@ -From de29341638833ba7717bd6b5e6850998454b044b Mon Sep 17 00:00:00 2001 -From: Kevin Atkinson -Date: Sat, 17 Aug 2019 17:06:53 -0400 -Subject: [PATCH] Don't allow null-terminated UCS-2/4 strings using the - original API. - -Detect if the encoding is UCS-2/4 and the length is -1 in affected API -functions and refuse to convert the string. If the string ends up -being converted somehow, abort with an error message in DecodeDirect -and ConvDirect. To convert a null terminated string in -Decode/ConvDirect, a negative number corresponding to the width of the -underlying character type for the encoding is expected; for example, -if the encoding is "ucs-2" then a the size is expected to be -2. - -Also fix a 1-3 byte over-read in DecodeDirect when reading UCS-2/4 -strings when a size is provided (found by OSS-Fuzz). - -Also fix a bug in DecodeDirect that caused DocumentChecker to return -the wrong offsets when working with UCS-2/4 strings. ---- - auto/MkSrc/CcHelper.pm | 99 ++++++++++++++++++++++++++++++++++--- - auto/MkSrc/Create.pm | 5 +- - auto/MkSrc/Info.pm | 5 +- - auto/MkSrc/ProcCc.pm | 24 +++++---- - auto/MkSrc/ProcImpl.pm | 57 +++++++++++++++------ - auto/MkSrc/Read.pm | 4 +- - auto/mk-src.in | 44 +++++++++++++++-- - common/convert.cpp | 39 ++++++++++++--- - common/convert.hpp | 38 +++++++++++++- - common/document_checker.cpp | 17 ++++++- - common/document_checker.hpp | 1 + - configure.ac | 8 +++ - manual/aspell.texi | 58 ++++++++++++++++------ - manual/readme.texi | 67 +++++++++++++++++++++---- - test/cxx_warnings_test.cpp | 84 +++++++++++++++++++++++++++++++ - test/wide_test_invalid.c | 69 ++++++++++++++++++++++++++ - test/wide_test_valid.c | 69 ++++++++++++++++++++++++++ - 17 files changed, 618 insertions(+), 70 deletions(-) - create mode 100644 test/cxx_warnings_test.cpp - create mode 100644 test/wide_test_invalid.c - create mode 100644 test/wide_test_valid.c - -diff --git a/auto/MkSrc/CcHelper.pm b/auto/MkSrc/CcHelper.pm -index e814a1a..9a96041 100644 ---- a/auto/MkSrc/CcHelper.pm -+++ b/auto/MkSrc/CcHelper.pm -@@ -10,8 +10,8 @@ BEGIN { - use Exporter; - our @ISA = qw(Exporter); - our @EXPORT = qw(to_c_return_type c_error_cond -- to_type_name make_desc make_func call_func -- make_c_method call_c_method form_c_method -+ to_type_name make_desc make_func call_func get_c_func_name -+ make_c_method make_wide_macro call_c_method form_c_method - make_cxx_method); - } - -@@ -90,6 +90,69 @@ sub make_func ( $ \@ $ ; \% ) { - ')')); - } - -+=item make_wide_version NAME @TYPES PARMS ; %ACCUM -+ -+Creates the wide character version of the function if needed -+ -+=cut -+ -+sub make_wide_version ( $ \@ $ ; \% ) { -+ my ($name, $d, $p, $accum) = @_; -+ my @d = @$d; -+ shift @d; -+ return '' unless grep {$_->{type} eq 'encoded string'} @d; -+ $accum->{sys_headers}{'stddef.h'} = true; -+ $accum->{suffix}[5] = <<'---'; -+ -+/******************* private implemantion details *********************/ -+ -+#ifdef __cplusplus -+# define aspell_cast_(type, expr) (static_cast(expr)) -+# define aspell_cast_from_wide_(str) (static_cast(str)) -+#else -+# define aspell_cast_(type, expr) ((type)(expr)) -+# define aspell_cast_from_wide_(str) ((const char *)(str)) -+#endif -+--- -+ my @parms = map {$_->{type} eq 'encoded string' -+ ? ($_->{name}, $_->{name}.'_size') -+ : $_->{name}} @d; -+ $name = to_lower $name; -+ $accum->{suffix}[0] = <<'---'; -+/**********************************************************************/ -+ -+#ifdef ASPELL_ENCODE_SETTING_SECURE -+--- -+ $accum->{suffix}[2] = "#endif\n"; -+ my @args = map {$_->{type} eq 'encoded string' -+ ? ($_->{name}, "$_->{name}_size", '-1') -+ : $_->{name}} @d; -+ $accum->{suffix}[1] .= -+ (join '', -+ "#define $name", -+ '(', join(', ', @parms), ')', -+ "\\\n ", -+ $name, '_wide', -+ '(', join(', ', @args), ')', -+ "\n"); -+ @args = map {$_->{type} eq 'encoded string' -+ ? ("aspell_cast_from_wide_($_->{name})", -+ "$_->{name}_size*aspell_cast_(int,sizeof(*($_->{name})))", -+ "sizeof(*($_->{name}))") -+ : $_->{name}} @d; -+ return (join '', -+ "\n", -+ "/* version of $name that is safe to use with (null terminated) wide characters */\n", -+ '#define ', -+ $name, '_w', -+ '(', join(', ', @parms), ')', -+ "\\\n ", -+ $name, '_wide', -+ '(', join(', ', @args), ')', -+ "\n"); -+} -+ -+ - =item call_func NAME @TYPES PARMS ; %ACCUM - - Return a string to call a func. Will prefix the function with return -@@ -103,7 +166,6 @@ Parms can be any of: - - sub call_func ( $ \@ $ ; \% ) { - my ($name, $d, $p, $accum) = @_; -- $accum = {} unless defined $accum; - my @d = @$d; - my $func_ret = to_type_name(shift @d, {%$p,pos=>'return'}, %$accum); - return (join '', -@@ -148,8 +210,14 @@ sub to_type_name ( $ $ ; \% ) { - my $name = $t->{name}; - my $type = $t->{type}; - -- return ( (to_type_name {%$d, type=>'string'}, $p, %$accum) , -- (to_type_name {%$d, type=>'int', name=>"$d->{name}_size"}, $p, %$accum) ) -+ if ($name eq 'encoded string' && $is_cc && $pos eq 'parm') { -+ my @types = ((to_type_name {%$d, type=>($p->{wide}?'const void pointer':'string')}, $p, %$accum), -+ (to_type_name {%$d, type=>'int', name=>"$d->{name}_size"}, $p, %$accum)); -+ push @types, (to_type_name {%$d, type=>'int', name=>"$d->{name}_type_width"}, $p, %$accum) if $p->{wide}; -+ return @types; -+ } -+ return ( (to_type_name {%$d, type=>($p->{wide}?'const void pointer':'string')}, $p, %$accum) , -+ (to_type_name {%$d, type=>'int', name=>"$d->{name}_size"}, $p, %$accum) ) - if $name eq 'encoded string' && $is_cc && $pos eq 'parm'; - - my $str; -@@ -174,7 +242,7 @@ sub to_type_name ( $ $ ; \% ) { - $str .= "String"; - } - } elsif ($name eq 'encoded string') { -- $str .= "const char *"; -+ $str .= $p->{wide} ? "const void *" : "const char *"; - } elsif ($name eq '') { - $str .= "void"; - } elsif ($name eq 'bool' && $is_cc) { -@@ -186,7 +254,7 @@ sub to_type_name ( $ $ ; \% ) { - if ($t->{pointer}) { - $accum->{types}->{$name} = $t; - } else { -- $accum->{headers}->{$t->{created_in}} = true; -+ $accum->{headers}->{$t->{created_in}} = true unless $mode eq 'cc'; - } - $str .= "$c_type Aspell" if $mode eq 'cc'; - $str .= to_mixed($name); -@@ -214,6 +282,7 @@ sub to_type_name ( $ $ ; \% ) { - return $str; - } - -+ - =item make_desc DESC ; LEVEL - - Make a C comment out of DESC optionally indenting it LEVEL spaces. -@@ -286,6 +355,7 @@ sub form_c_method ($ $ $ ; \% ) - } else { - $func = "aspell $class $name"; - } -+ $func .= " wide" if $p->{wide}; - if (exists $d->{'const'}) { - splice @data, 1, 0, {type => "const $class", name=> $this_name}; - } else { -@@ -306,6 +376,21 @@ sub make_c_method ($ $ $ ; \%) - return &make_func(@ret); - } - -+sub get_c_func_name ($ $ $) -+{ -+ my @ret = &form_c_method(@_); -+ return undef unless @ret > 0; -+ return to_lower $ret[0]; -+} -+ -+sub make_wide_macro ($ $ $ ; \%) -+{ -+ my @ret = &form_c_method(@_); -+ return undef unless @ret > 0; -+ my $str = &make_wide_version(@ret); -+ return $str; -+} -+ - sub call_c_method ($ $ $ ; \%) - { - my @ret = &form_c_method(@_); -diff --git a/auto/MkSrc/Create.pm b/auto/MkSrc/Create.pm -index e467a10..d76af15 100644 ---- a/auto/MkSrc/Create.pm -+++ b/auto/MkSrc/Create.pm -@@ -75,8 +75,10 @@ sub create_cc_file ( % ) { - $file .= "#include \"aspell.h\"\n" if $p{type} eq 'cxx'; - $file .= "#include \"settings.h\"\n" if $p{type} eq 'native_impl' && $p{name} eq 'errors'; - $file .= "#include \"gettext.h\"\n" if $p{type} eq 'native_impl' && $p{name} eq 'errors'; -+ $file .= cmap {"#include <$_>\n"} sort keys %{$accum{sys_headers}}; - $file .= cmap {"#include \"".to_lower($_).".hpp\"\n"} sort keys %{$accum{headers}}; -- $file .= "#ifdef __cplusplus\nextern \"C\" {\n#endif\n" if $p{header} && !$p{cxx}; -+ $file .= "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n" if $p{header} && !$p{cxx}; -+ $file .= join('', grep {defined $_} @{$accum{prefix}}); - $file .= "\nnamespace $p{namespace} {\n\n" if $p{cxx}; - if (defined $info{forward}{proc}{$p{type}}) { - my @types = sort {$a->{name} cmp $b->{name}} (values %{$accum{types}}); -@@ -84,6 +86,7 @@ sub create_cc_file ( % ) { - } - $file .= "\n"; - $file .= $body; -+ $file .= join('', grep {defined $_} @{$accum{suffix}}); - $file .= "\n\n}\n\n" if $p{cxx}; - $file .= "#ifdef __cplusplus\n}\n#endif\n" if $p{header} && !$p{cxx}; - $file .= "#endif /* $hm */\n" if $p{header}; -diff --git a/auto/MkSrc/Info.pm b/auto/MkSrc/Info.pm -index 5d30ec5..a131b2e 100644 ---- a/auto/MkSrc/Info.pm -+++ b/auto/MkSrc/Info.pm -@@ -60,6 +60,7 @@ each proc sub should take the following argv - the object from which it is a member of - no native: do not attemt to create a native implementation - treat as object: treat as a object rather than a pointer -+ no conv: do not converted an encoded string - - The %info structure is initialized as follows: - -@@ -104,8 +105,8 @@ The %info structure is initialized as follows: - errors => {}, # possible errors - method => { - # A class method -- options => ['desc', 'posib err', 'c func', 'const', -- 'c only', 'c impl', 'cxx impl'], -+ options => ['desc', 'posib err', 'c func', 'const', 'no conv', 'on conv error', -+ 'c only', 'c impl', 'cxx impl', 'cc extra'], - groups => undef}, - constructor => { - # A class constructor -diff --git a/auto/MkSrc/ProcCc.pm b/auto/MkSrc/ProcCc.pm -index 47c4338..98cc435 100644 ---- a/auto/MkSrc/ProcCc.pm -+++ b/auto/MkSrc/ProcCc.pm -@@ -23,7 +23,7 @@ use MkSrc::Info; - sub make_c_object ( $ @ ); - - $info{group}{proc}{cc} = sub { -- my ($data) = @_; -+ my ($data,@rest) = @_; - my $ret; - my $stars = (70 - length $data->{name})/2; - $ret .= "/"; -@@ -33,14 +33,14 @@ $info{group}{proc}{cc} = sub { - $ret .= "/\n"; - foreach my $d (@{$data->{data}}) { - $ret .= "\n\n"; -- $ret .= $info{$d->{type}}{proc}{cc}->($d); -+ $ret .= $info{$d->{type}}{proc}{cc}->($d,@rest); - } - $ret .= "\n\n"; - return $ret; - }; - - $info{enum}{proc}{cc} = sub { -- my ($d) = @_; -+ my ($d,@rest) = @_; - my $n = "Aspell".to_mixed($d->{name}); - return ("\n". - make_desc($d->{desc}). -@@ -58,21 +58,26 @@ $info{struct}{proc}{cc} = sub { - }; - - $info{union}{proc}{cc} = sub { -- return make_c_object "union", $_[0]; -+ return make_c_object "union", @_; - }; - - $info{class}{proc}{cc} = sub { -- my ($d) = @_; -+ my ($d,$accum) = @_; - my $class = $d->{name}; - my $classname = "Aspell".to_mixed($class); - my $ret = ""; - $ret .= "typedef struct $classname $classname;\n\n"; - foreach (@{$d->{data}}) { -- my $s = make_c_method($class, $_, {mode=>'cc'}); -+ my $s = make_c_method($class, $_, {mode=>'cc'}, %$accum); - next unless defined $s; - $ret .= "\n"; - $ret .= make_desc($_->{desc}); -- $ret .= make_c_method($class, $_, {mode=>'cc'}).";\n"; -+ $ret .= make_c_method($class, $_, {mode=>'cc'}, %$accum).";\n"; -+ if (grep {$_->{type} eq 'encoded string'} @{$_->{data}}) { -+ $ret .= make_c_method($class, $_, {mode=>'cc', wide=>true}, %$accum).";\n"; -+ $ret .= make_wide_macro($class, $_, {mode=>'cc'}, %$accum); -+ } -+ $ret .= "\n".$_->{'cc extra'}."\n" if defined $_->{'cc extra'}; - } - $ret .= "\n"; - return $ret; -@@ -105,7 +110,8 @@ $info{errors}{proc}{cc} = sub { - }; - - sub make_c_object ( $ @ ) { -- my ($t, $d) = @_; -+ my ($t, $d, $accum) = @_; -+ $accum = {} unless defined $accum; - my $struct; - $struct .= "Aspell"; - $struct .= to_mixed($d->{name}); -@@ -120,7 +126,7 @@ sub make_c_object ( $ @ ) { - "\n};\n"), - "typedef $t $struct $struct;", - join ("\n", -- map {make_c_method($d->{name}, $_, {mode=>'cc'}).";"} -+ map {make_c_method($d->{name}, $_, {mode=>'cc'}, %$accum).";"} - grep {$_->{type} eq 'method'} - @{$d->{data}}) - )."\n"; -diff --git a/auto/MkSrc/ProcImpl.pm b/auto/MkSrc/ProcImpl.pm -index b8628fd..3d0f220 100644 ---- a/auto/MkSrc/ProcImpl.pm -+++ b/auto/MkSrc/ProcImpl.pm -@@ -45,10 +45,13 @@ $info{class}{proc}{impl} = sub { - foreach (grep {$_ ne ''} split /\s*,\s*/, $data->{'c impl headers'}) { - $accum->{headers}{$_} = true; - } -- foreach my $d (@{$data->{data}}) { -+ my @d = @{$data->{data}}; -+ while (@d) { -+ my $d = shift @d; -+ my $need_wide = false; - next unless one_of $d->{type}, qw(method constructor destructor); - my @parms = @{$d->{data}} if exists $d->{data}; -- my $m = make_c_method $data->{name}, $d, {mode=>'cc_cxx', use_name=>true}, %$accum; -+ my $m = make_c_method $data->{name}, $d, {mode=>'cc_cxx', use_name=>true, wide=>$d->{wide}}, %$accum; - next unless defined $m; - $ret .= "extern \"C\" $m\n"; - $ret .= "{\n"; -@@ -57,24 +60,49 @@ $info{class}{proc}{impl} = sub { - } else { - if ($d->{type} eq 'method') { - my $ret_type = shift @parms; -- my $ret_native = to_type_name $ret_type, {mode=>'native_no_err', pos=>'return'}, %$accum; -+ my $ret_native = to_type_name $ret_type, {mode=>'native_no_err', pos=>'return', wide=>$d->{wide}}, %$accum; - my $snum = 0; -+ my $call_fun = $d->{name}; -+ my @call_parms; - foreach (@parms) { - my $n = to_lower($_->{name}); -- if ($_->{type} eq 'encoded string') { -- $accum->{headers}{'mutable string'} = true; -- $accum->{headers}{'convert'} = true; -- $ret .= " ths->temp_str_$snum.clear();\n"; -- $ret .= " ths->to_internal_->convert($n, ${n}_size, ths->temp_str_$snum);\n"; -- $ret .= " unsigned int s$snum = ths->temp_str_$snum.size();\n"; -- $_ = "MutableString(ths->temp_str_$snum.mstr(), s$snum)"; -- $snum++; -+ if ($_->{type} eq 'encoded string' && !exists($d->{'no conv'})) { -+ $need_wide = true unless $d->{wide}; -+ die unless exists $d->{'posib err'}; -+ $accum->{headers}{'mutable string'} = true; -+ $accum->{headers}{'convert'} = true; -+ my $name = get_c_func_name $data->{name}, $d, {mode=>'cc_cxx', use_name=>true, wide=>$d->{wide}}; -+ $ret .= " ths->temp_str_$snum.clear();\n"; -+ if ($d->{wide}) { -+ $ret .= " ${n}_size = get_correct_size(\"$name\", ths->to_internal_->in_type_width(), ${n}_size, ${n}_type_width);\n"; -+ } else { -+ $ret .= " PosibErr ${n}_fixed_size = get_correct_size(\"$name\", ths->to_internal_->in_type_width(), ${n}_size);\n"; -+ if (exists($d->{'on conv error'})) { -+ $ret .= " if (${n}_fixed_size.get_err()) {\n"; -+ $ret .= " ".$d->{'on conv error'}."\n"; -+ $ret .= " } else {\n"; -+ $ret .= " ${n}_size = ${n}_fixed_size;\n"; -+ $ret .= " }\n"; -+ } else { -+ $ret .= " ths->err_.reset(${n}_fixed_size.release_err());\n"; -+ $ret .= " if (ths->err_ != 0) return ".(c_error_cond $ret_type).";\n"; -+ } -+ } -+ $ret .= " ths->to_internal_->convert($n, ${n}_size, ths->temp_str_$snum);\n"; -+ $ret .= " unsigned int s$snum = ths->temp_str_$snum.size();\n"; -+ push @call_parms, "MutableString(ths->temp_str_$snum.mstr(), s$snum)"; -+ $snum++; -+ } elsif ($_->{type} eq 'encoded string') { -+ $need_wide = true unless $d->{wide}; -+ push @call_parms, $n, "${n}_size"; -+ push @call_parms, "${n}_type_width" if $d->{wide}; -+ $call_fun .= " wide" if $d->{wide}; - } else { -- $_ = $n; -+ push @call_parms, $n; - } - } -- my $parms = '('.(join ', ', @parms).')'; -- my $exp = "ths->".to_lower($d->{name})."$parms"; -+ my $parms = '('.(join ', ', @call_parms).')'; -+ my $exp = "ths->".to_lower($call_fun)."$parms"; - if (exists $d->{'posib err'}) { - $accum->{headers}{'posib err'} = true; - $ret .= " PosibErr<$ret_native> ret = $exp;\n"; -@@ -118,6 +146,7 @@ $info{class}{proc}{impl} = sub { - } - } - $ret .= "}\n\n"; -+ unshift @d,{%$d, wide=>true} if $need_wide; - } - return $ret; - }; -diff --git a/auto/MkSrc/Read.pm b/auto/MkSrc/Read.pm -index 4b3d1d0..4bf640e 100644 ---- a/auto/MkSrc/Read.pm -+++ b/auto/MkSrc/Read.pm -@@ -88,13 +88,13 @@ sub advance ( ) { - $in_pod = $1 if $line =~ /^\=(\w+)/; - $line = '' if $in_pod; - $in_pod = undef if $in_pod && $in_pod eq 'cut'; -- $line =~ s/\#.*$//; -+ $line =~ s/(? "%expression" is not a valid regular expression. - parms => expression -+ - } - group: speller - { -@@ -641,6 +642,7 @@ class: speller - posib err - desc => Returns 0 if it is not in the dictionary, - 1 if it is, or -1 on error. -+ on conv error => return 0; - / - bool - encoded string: word -@@ -706,6 +708,8 @@ class: speller - desc => Return NULL on error. - The word list returned by suggest is only - valid until the next call to suggest. -+ on conv error => -+ word = NULL; word_size = 0; - / - const word list - encoded string: word -@@ -831,7 +835,6 @@ class: document checker - void - - method: process -- - desc => Process a string. - The string passed in should only be split on - white space characters. Furthermore, between -@@ -840,10 +843,10 @@ class: document checker - in the document. Passing in strings out of - order, skipping strings or passing them in - more than once may lead to undefined results. -+ no conv - / - void -- string: str -- int: size -+ encoded string: str - - method: next misspelling - -@@ -851,9 +854,23 @@ class: document checker - processed string. If there are no more - misspelled words, then token.word will be - NULL and token.size will be 0 -+ cc extra => -+ \#define aspell_document_checker_next_misspelling_w(type, ths) \\ -+ aspell_document_checker_next_misspelling_adj(ths, sizeof(type)) - / - token object - -+ method: next misspelling adj -+ desc => internal: do not use -+ c impl => -+ Token res = ths->next_misspelling(); -+ res.offset /= type_width; -+ res.len /= type_width; -+ return res; -+ / -+ token object -+ int: type_width -+ - method: filter - - desc => Returns the underlying filter class. -@@ -913,9 +930,30 @@ class: string enumeration - ths->from_internal_->append_null(ths->temp_str); - return ths->temp_str.data(); - \} -+ cc extra => -+ \#define aspell_string_enumeration_next_w(type, ths) \\ -+ aspell_cast_(const type *, aspell_string_enumeration_next_wide(ths, sizeof(type))) - / - const string - -+ method: next wide -+ c impl => -+ const char * s = ths->next(); -+ if (s == 0) { -+ return s; -+ } else if (ths->from_internal_ == 0) \{ -+ assert(type_width == 1); -+ return s; -+ \} else \{ -+ assert(type_width == ths->from_internal_->out_type_width()); -+ ths->temp_str.clear(); -+ ths->from_internal_->convert(s,-1,ths->temp_str); -+ ths->from_internal_->append_null(ths->temp_str); -+ return ths->temp_str.data(); -+ \} -+ / -+ const void pointer -+ int: type_width - } - group: info - { -diff --git a/common/convert.cpp b/common/convert.cpp -index 7fd3895..77804c0 100644 ---- a/common/convert.cpp -+++ b/common/convert.cpp -@@ -511,18 +511,25 @@ namespace acommon { - // Trivial Conversion - // - -+ const char * unsupported_null_term_wide_string_msg = -+ "Null-terminated wide-character strings unsupported when used this way."; -+ - template - struct DecodeDirect : public Decode - { -+ DecodeDirect() {type_width = sizeof(Chr);} - void decode(const char * in0, int size, FilterCharVector & out) const { - const Chr * in = reinterpret_cast(in0); -- if (size == -1) { -+ if (size == -sizeof(Chr)) { - for (;*in; ++in) -- out.append(*in); -+ out.append(*in, sizeof(Chr)); -+ } else if (size <= -1) { -+ fprintf(stderr, "%s\n", unsupported_null_term_wide_string_msg); -+ abort(); - } else { -- const Chr * stop = reinterpret_cast(in0 +size); -+ const Chr * stop = reinterpret_cast(in0) + size/sizeof(Chr); - for (;in != stop; ++in) -- out.append(*in); -+ out.append(*in, sizeof(Chr)); - } - } - PosibErr decode_ec(const char * in0, int size, -@@ -535,6 +542,7 @@ namespace acommon { - template - struct EncodeDirect : public Encode - { -+ EncodeDirect() {type_width = sizeof(Chr);} - void encode(const FilterChar * in, const FilterChar * stop, - CharVector & out) const { - for (; in != stop; ++in) { -@@ -564,11 +572,15 @@ namespace acommon { - template - struct ConvDirect : public DirectConv - { -+ ConvDirect() {type_width = sizeof(Chr);} - void convert(const char * in0, int size, CharVector & out) const { -- if (size == -1) { -+ if (size == -sizeof(Chr)) { - const Chr * in = reinterpret_cast(in0); - for (;*in != 0; ++in) - out.append(in, sizeof(Chr)); -+ } else if (size <= -1) { -+ fprintf(stderr, "%s\n", unsupported_null_term_wide_string_msg); -+ abort(); - } else { - out.append(in0, size); - } -@@ -1092,5 +1104,20 @@ namespace acommon { - } - return 0; - } -- -+ -+ PosibErr unsupported_null_term_wide_string_err_(const char * func) { -+ static bool reported_to_stderr = false; -+ PosibErr err = make_err(other_error, unsupported_null_term_wide_string_msg); -+ if (!reported_to_stderr) { -+ CERR.printf("ERROR: %s: %s\n", func, unsupported_null_term_wide_string_msg); -+ reported_to_stderr = true; -+ } -+ return err; -+ } -+ -+ void unsupported_null_term_wide_string_abort_(const char * func) { -+ CERR.printf("%s: %s\n", unsupported_null_term_wide_string_msg); -+ abort(); -+ } -+ - } -diff --git a/common/convert.hpp b/common/convert.hpp -index 76332ee..c948973 100644 ---- a/common/convert.hpp -+++ b/common/convert.hpp -@@ -7,6 +7,8 @@ - #ifndef ASPELL_CONVERT__HPP - #define ASPELL_CONVERT__HPP - -+#include "settings.h" -+ - #include "string.hpp" - #include "posib_err.hpp" - #include "char_vector.hpp" -@@ -25,8 +27,9 @@ namespace acommon { - typedef const Config CacheConfig; - typedef const char * CacheKey; - String key; -+ int type_width; // type width in bytes - bool cache_key_eq(const char * l) const {return key == l;} -- ConvBase() {} -+ ConvBase() : type_width(1) {} - private: - ConvBase(const ConvBase &); - void operator=(const ConvBase &); -@@ -56,6 +59,8 @@ namespace acommon { - virtual ~Encode() {} - }; - struct DirectConv { // convert directly from in_code to out_code. -+ int type_width; // type width in bytes -+ DirectConv() : type_width(1) {} - // should not take ownership of decode and encode. - // decode and encode guaranteed to stick around for the life - // of the object. -@@ -126,6 +131,9 @@ namespace acommon { - const char * in_code() const {return decode_->key.c_str();} - const char * out_code() const {return encode_->key.c_str();} - -+ int in_type_width() const {return decode_->type_width;} -+ int out_type_width() const {return encode_->type_width;} -+ - void append_null(CharVector & out) const - { - const char nul[4] = {0,0,0,0}; // 4 should be enough -@@ -191,6 +199,10 @@ namespace acommon { - } - } - -+ void convert(const void * in, int size, CharVector & out) { -+ convert(static_cast(in), size, out); -+ } -+ - void generic_convert(const char * in, int size, CharVector & out); - - }; -@@ -412,6 +424,30 @@ namespace acommon { - return operator()(str, str + byte_size);} - }; - -+#ifdef SLOPPY_NULL_TERM_STRINGS -+ static const bool sloppy_null_term_strings = true; -+#else -+ static const bool sloppy_null_term_strings = false; -+#endif -+ -+ PosibErr unsupported_null_term_wide_string_err_(const char * func); -+ void unsupported_null_term_wide_string_abort_(const char * func); -+ -+ static inline PosibErr get_correct_size(const char * func, int conv_type_width, int size) { -+ if (sloppy_null_term_strings && size <= -1) -+ return -conv_type_width; -+ if (size <= -1 && -conv_type_width != size) -+ return unsupported_null_term_wide_string_err_(func); -+ return size; -+ } -+ static inline int get_correct_size(const char * func, int conv_type_width, int size, int type_width) { -+ if ((sloppy_null_term_strings || type_width <= -1) && size <= -1) -+ return -conv_type_width; -+ if (size <= -1 && conv_type_width != type_width) -+ unsupported_null_term_wide_string_abort_(func); -+ return size; -+ } -+ - } - - #endif -diff --git a/common/document_checker.cpp b/common/document_checker.cpp -index 5e510c4..0ccf1cd 100644 ---- a/common/document_checker.cpp -+++ b/common/document_checker.cpp -@@ -44,7 +44,9 @@ namespace acommon { - void DocumentChecker::process(const char * str, int size) - { - proc_str_.clear(); -- conv_->decode(str, size, proc_str_); -+ PosibErr fixed_size = get_correct_size("aspell_document_checker_process", conv_->in_type_width(), size); -+ if (!fixed_size.has_err()) -+ conv_->decode(str, fixed_size, proc_str_); - proc_str_.append(0); - FilterChar * begin = proc_str_.pbegin(); - FilterChar * end = proc_str_.pend() - 1; -@@ -53,6 +55,19 @@ namespace acommon { - tokenizer_->reset(begin, end); - } - -+ void DocumentChecker::process_wide(const void * str, int size, int type_width) -+ { -+ proc_str_.clear(); -+ int fixed_size = get_correct_size("aspell_document_checker_process", conv_->in_type_width(), size, type_width); -+ conv_->decode(static_cast(str), fixed_size, proc_str_); -+ proc_str_.append(0); -+ FilterChar * begin = proc_str_.pbegin(); -+ FilterChar * end = proc_str_.pend() - 1; -+ if (filter_) -+ filter_->process(begin, end); -+ tokenizer_->reset(begin, end); -+ } -+ - Token DocumentChecker::next_misspelling() - { - bool correct; -diff --git a/common/document_checker.hpp b/common/document_checker.hpp -index d35bb88..11a3c73 100644 ---- a/common/document_checker.hpp -+++ b/common/document_checker.hpp -@@ -36,6 +36,7 @@ namespace acommon { - PosibErr setup(Tokenizer *, Speller *, Filter *); - void reset(); - void process(const char * str, int size); -+ void process_wide(const void * str, int size, int type_width); - Token next_misspelling(); - - Filter * filter() {return filter_;} -diff --git a/configure.ac b/configure.ac -index ed26945..51a31cb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -70,6 +70,9 @@ AC_ARG_ENABLE(compile-in-filters, - AC_ARG_ENABLE(filter-version-control, - [ --disable-filter-version-control]) - -+AC_ARG_ENABLE(sloppy-null-term-strings, -+ AS_HELP_STRING([--enable-sloppy-null-term-strings],[allows allow null terminated UCS-2 and UCS-4 strings])) -+ - AC_ARG_ENABLE(pspell-compatibility, - AS_HELP_STRING([--disable-pspell-compatibility],[don't install pspell compatibility libraries])) - -@@ -133,6 +136,11 @@ fi - AM_CONDITIONAL(COMPILE_IN_FILTERS, - [test "$enable_compile_in_filters" = "yes"]) - -+if test "$enable_sloppy_null_term_strings" = "yes" -+then -+ AC_DEFINE(SLOPPY_NULL_TERM_STRINGS, 1, [Defined if null-terminated UCS-2 and UCS-4 strings should always be allowed.]) -+fi -+ - AM_CONDITIONAL(PSPELL_COMPATIBILITY, - [test "$enable_pspell_compatibility" != "no"]) - AM_CONDITIONAL(INCREMENTED_SONAME, -diff --git a/manual/aspell.texi b/manual/aspell.texi -index 080f894..f331fb0 100644 ---- a/manual/aspell.texi -+++ b/manual/aspell.texi -@@ -158,7 +158,8 @@ Installing - - * Generic Install Instructions:: - * HTML Manuals and "make clean":: --* Curses Notes:: -+* Curses Notes:: -+* Upgrading from Aspell 0.60.7:: - * Loadable Filter Notes:: - * Upgrading from Aspell 0.50:: - * Upgrading from Aspell .33/Pspell .12:: -@@ -2196,18 +2197,26 @@ int correct = aspell_speller_check(spell_checker, @var{word}, @var{size}); - @end smallexample - - @noindent --@var{word} is expected to be a @code{const char *} character --string. If the encoding is set to be @code{ucs-2} or --@code{ucs-4} @var{word} is expected to be a cast --from either @code{const u16int *} or @code{const u32int *} --respectively. @code{u16int} and @code{u32int} are generally --@code{unsigned short} and @code{unsigned int} respectively. --@var{size} is the length of the string or @code{-1} if the string --is null terminated. If the string is a cast from @code{const u16int --*} or @code{const u32int *} then @code{@i{size}} is the amount of --space in bytes the string takes up after being cast to @code{const --char *} and not the true size of the string. @code{sspell_speller_check} --will return @code{0} if it is not found and non-zero otherwise. -+@var{word} is expected to be a @code{const char *} character string. -+@var{size} is the length of the string or @code{-1} if the string is -+null terminated. @code{aspell_speller_check} will return @code{0} if it is not found -+and non-zero otherwise. -+ -+If you are using the @code{ucs-2} or @code{ucs-4} encoding then the -+string is expected to be either a 2 or 4 byte wide integer -+(respectively) and the @code{_w} macro vesion should be used: -+ -+@smallexample -+int correct = aspell_speller_check_w(spell_checker, @var{word}, @var{size}); -+@end smallexample -+ -+The macro will cast the string to to the correct type and convert -+@var{size} into bytes for you and then a call the special wide version of the -+function that will make sure the encoding is correct for the type -+passed in. For compatibility with older versions of Aspell the normal -+non-wide functions can still be used provided that the size of the -+string, in bytes, is also passed in. Null terminated @code{ucs-2} or -+@code{ucs-4} are no longer supported when using the non-wide functions. - - If the word is not correct, then the @code{suggest} method can be used - to come up with likely replacements. -@@ -2226,7 +2235,28 @@ delete_aspell_string_enumeration(elements); - - Notice how @code{elements} is deleted but @code{suggestions} is not. - The value returned by @code{suggestions} is only valid to the next --call to @code{suggest}. Once a replacement is made the -+call to @code{suggest}. -+ -+If you are using the @code{ucs-2} or @code{ucs-4} encoding then, in -+addition to using the @code{_w} macro for the @code{suggest} method, you -+should also use the @code{_w} macro with the @code{next} method which -+will cast the string to the correct type for you. For example, if you -+are using the @code{ucs-2} encoding and the string is a @code{const -+uint16_t *} then you should use: -+ -+@smallexample -+AspellWordList * suggestions = aspell_speller_suggest_w(spell_checker, -+ @var{word}, @var{size}); -+AspellStringEnumeration * elements = aspell_word_list_elements(suggestions); -+const uint16_t * word; -+while ( (word = aspell_string_enumeration_next_w(uint16_t, aspell_elements)) != NULL ) -+@{ -+ // add to suggestion list -+@} -+delete_aspell_string_enumeration(elements); -+@end smallexample -+ -+Once a replacement is made the - @code{store_repl} method should be used to communicate the replacement - pair back to the spell checker (for the reason, @pxref{Notes on - Storing Replacement Pairs}). Its usage is as follows: -diff --git a/manual/readme.texi b/manual/readme.texi -index 4bfb2e2..ae680da 100644 ---- a/manual/readme.texi -+++ b/manual/readme.texi -@@ -15,14 +15,16 @@ The latest version can always be found at GNU Aspell's home page at - @uref{http://aspell.net}. - - @menu --* Generic Install Instructions:: --* HTML Manuals and "make clean":: --* Curses Notes:: --* Loadable Filter Notes:: --* Upgrading from Aspell 0.50:: --* Upgrading from Aspell .33/Pspell .12:: --* Upgrading from a Pre-0.50 snapshot:: --* WIN32 Notes:: -+* Generic Install Instructions:: -+* HTML Manuals and "make clean":: -+* Curses Notes:: -+* Upgrading from Aspell 0.60.7:: -+* Loadable Filter Notes:: -+* Using 32-Bit Dictionaries on a 64-Bit System:: -+* Upgrading from Aspell 0.50:: -+* Upgrading from Aspell .33/Pspell .12:: -+* Upgrading from a Pre-0.50 snapshot:: -+* WIN32 Notes:: - @end menu - - @node Generic Install Instructions -@@ -120,6 +122,52 @@ In addition your system must also support the @code{mblen} function. - Although this function was defined in the ISO C89 standard (ANSI - X3.159-1989), not all systems have it. - -+@node Upgrading from Aspell 0.60.7 -+@appendixsec Upgrading from Aspell 0.60.7 -+ -+To prevent a potentially unbounded buffer over-read, Aspell no longer -+supports null-terminated UCS-2 and UCS-4 encoded strings with the -+original C API. Null-termianted 8-bit or UTF-8 encoded strings are -+still supported, as are UCS-2 and UCS-4 encoded strings when the -+length is passed in. -+ -+As of Aspell 0.60.8 a function from the original API that expects an -+encoded string as a parameter will return meaningless results (or an -+error code) if string is null terminated and the encoding is set to -+@code{ucs-2} or @code{ucs-4}. In addition, a single: -+@example -+ERROR: aspell_speller_check: Null-terminated wide-character strings unsupported when used this way. -+@end example -+will be printed to standard error the first time one of those -+functions is called. -+ -+Application that use null-terminated UCS-2/4 strings should either (1) -+use the interface intended for working with wide-characters -+(@xref{Through the C API}); or (2) define -+@code{ASPELL_ENCODE_SETTING_SECURE} before including @code{aspell.h}. -+In the latter case is is important that the application explicitly -+sets the encoding to a known value. Defining -+@code{ASPELL_ENCODE_SETTING_SECURE} and not setting the encoding -+explicitly or allowing user of the application to set the encoding -+could result in an unbounded buffer over-read. -+ -+If it is necessary to preserve binary compatibility with older -+versions of Aspell, the easiest thing would be to determine the length -+of the UCS-2/4 string---in bytes---and pass that in. Due to an -+implemenation detail, existing API functions can be made to work with -+null-terminated UCS-2/4 strings safely by passing in either @code{-2} -+or @code{-4} (corresponding to the width of the character type) as the -+size. Doing so, however, will cause a buffer over-read for unpatched -+version of Aspell. To avoid this it will be necessary to parse the -+version string to determine the correct value to use. However, no -+official support will be provided for the latter method. -+ -+If the application can not be recompiled, then Aspell can be configured -+to preserve the old behavior by passing -+@option{--enable-sloppy-null-term-strings} to @command{configure}. When Aspell -+is compiled this way the version string will include the string -+@samp{ SLOPPY}. -+ - @node Loadable Filter Notes - @appendixsec Loadable Filter Notes - -@@ -129,8 +177,7 @@ errors when trying to use a filter, then it is likely that loadable - filter support is not working yet on your platform. Thus, in order to - get Aspell to work correctly you will need to avoid compiling the - filters as individual modules by using the --@option{--enable-compile-in-filters} when configuring Aspell with --@command{./configure}. -+@option{--enable-compile-in-filters} @command{configure} option. - - @node Upgrading from Aspell 0.50 - @appendixsec Upgrading from Aspell 0.50 -diff --git a/test/cxx_warnings_test.cpp b/test/cxx_warnings_test.cpp -new file mode 100644 -index 0000000..923bfc8 ---- /dev/null -+++ b/test/cxx_warnings_test.cpp -@@ -0,0 +1,84 @@ -+ #include -+#include -+#include -+#include -+ -+#include -+ -+const uint16_t test_word[] = {'c','a','f', 0x00E9, 0}; -+const uint16_t test_incorrect[] = {'c','a','f', 'e', 0}; -+const uint16_t test_doc[] = {'T', 'h', 'e', ' ', 'c','a','f', 0x00E9, '.', 0}; -+ -+int fail = 0; -+ -+void f1() { -+ AspellConfig * spell_config = new_aspell_config(); -+ aspell_config_replace(spell_config, "master", "en_US-w_accents"); -+ aspell_config_replace(spell_config, "encoding", "ucs-2"); -+ AspellCanHaveError * possible_err = new_aspell_speller(spell_config); -+ AspellSpeller * spell_checker = 0; -+ if (aspell_error_number(possible_err) != 0) { -+ fprintf(stderr, "%s", aspell_error_message(possible_err)); -+ exit(0); -+ } else { -+ spell_checker = to_aspell_speller(possible_err); -+ } -+ int correct = aspell_speller_check_w(spell_checker, test_word, -1); -+ if (!correct) { -+ fprintf(stderr, "%s", "fail: expected word to be correct\n"); -+ fail = 1; -+ } -+ correct = aspell_speller_check_w(spell_checker, test_incorrect, -1); -+ if (correct) { -+ fprintf(stderr, "%s", "fail: expected word to be incorrect\n"); -+ fail = 1; -+ } -+ const AspellWordList * suggestions = aspell_speller_suggest_w(spell_checker, test_incorrect, -1); -+ AspellStringEnumeration * elements = aspell_word_list_elements(suggestions); -+ const uint16_t * word = aspell_string_enumeration_next_w(uint16_t, elements); -+ if (memcmp(word, test_word, sizeof(test_incorrect)) != 0) { -+ fprintf(stderr, "%s", "fail: first suggesion is not what is expected\n"); -+ fail = 1; -+ delete_aspell_string_enumeration(elements); -+ } -+ if (fail) -+ printf("not ok\n"); -+ else -+ printf("ok\n"); -+} -+ -+void f2() { -+ AspellConfig * spell_config = new_aspell_config(); -+ aspell_config_replace(spell_config, "master", "en_US-w_accents"); -+ aspell_config_replace(spell_config, "encoding", "ucs-2"); -+ AspellCanHaveError * possible_err = new_aspell_speller(spell_config); -+ AspellSpeller * spell_checker = 0; -+ if (aspell_error_number(possible_err) != 0) { -+ fprintf(stderr, "%s", aspell_error_message(possible_err)); -+ exit(0); -+ } else { -+ spell_checker = to_aspell_speller(possible_err); -+ } -+ int correct = aspell_speller_check_w(spell_checker, test_word, -1); -+ if (!correct) { -+ fprintf(stderr, "%s", "fail: expected word to be correct\n"); -+ fail = 1; -+ } -+ correct = aspell_speller_check_w(spell_checker, test_incorrect, -1); -+ if (correct) { -+ fprintf(stderr, "%s", "fail: expected word to be incorrect\n"); -+ fail = 1; -+ } -+ const AspellWordList * suggestions = aspell_speller_suggest_w(spell_checker, test_incorrect, -1); -+ AspellStringEnumeration * elements = aspell_word_list_elements(suggestions); -+ const uint16_t * word = aspell_string_enumeration_next_w(uint16_t, elements); -+ if (memcmp(word, test_word, sizeof(test_incorrect)) != 0) { -+ fprintf(stderr, "%s", "fail: first suggesion is not what is expected\n"); -+ fail = 1; -+ delete_aspell_string_enumeration(elements); -+ } -+ if (fail) -+ printf("not ok\n"); -+ else -+ printf("ok\n"); -+} -diff --git a/test/wide_test_invalid.c b/test/wide_test_invalid.c -new file mode 100644 -index 0000000..d5e2ed7 ---- /dev/null -+++ b/test/wide_test_invalid.c -@@ -0,0 +1,69 @@ -+#include -+#include -+#include -+#include -+ -+#include -+ -+const uint16_t test_word[] = {'c','a','f', 0x00E9, 0}; -+const uint16_t test_incorrect[] = {'c','a','f', 'e', 0}; -+const uint16_t test_doc[] = {'T', 'h', 'e', ' ', 'c','a','f', 'e', '.', 0}; -+ -+int fail = 0; -+ -+int main() { -+ AspellConfig * spell_config = new_aspell_config(); -+ aspell_config_replace(spell_config, "master", "en_US-w_accents"); -+ aspell_config_replace(spell_config, "encoding", "ucs-2"); -+ AspellCanHaveError * possible_err = new_aspell_speller(spell_config); -+ AspellSpeller * spell_checker = 0; -+ if (aspell_error_number(possible_err) != 0) { -+ fprintf(stderr, "%s", aspell_error_message(possible_err)); -+ return 2; -+ } else { -+ spell_checker = to_aspell_speller(possible_err); -+ } -+ int correct = aspell_speller_check(spell_checker, (const char *)test_word, -1); -+ if (!correct) { -+ fprintf(stderr, "%s", "fail: expected word to be correct\n"); -+ fail = 1; -+ } -+ correct = aspell_speller_check(spell_checker, (const char *)test_incorrect, -1); -+ if (correct) { -+ fprintf(stderr, "%s", "fail: expected word to be incorrect\n"); -+ fail = 1; -+ } -+ const AspellWordList * suggestions = aspell_speller_suggest(spell_checker, (const char *)test_incorrect, -1); -+ AspellStringEnumeration * elements = aspell_word_list_elements(suggestions); -+ const char * word = aspell_string_enumeration_next(elements); -+ if (memcmp(word, test_word, sizeof(test_incorrect)) != 0) { -+ fprintf(stderr, "%s", "fail: first suggesion is not what is expected\n"); -+ fail = 1; -+ } -+ delete_aspell_string_enumeration(elements); -+ -+ possible_err = new_aspell_document_checker(spell_checker); -+ if (aspell_error(possible_err) != 0) { -+ fprintf(stderr, "Error: %s\n",aspell_error_message(possible_err)); -+ return 2; -+ } -+ AspellDocumentChecker * checker = to_aspell_document_checker(possible_err); -+ aspell_document_checker_process(checker, (const char *)test_doc, -1); -+ -+ AspellToken token = aspell_document_checker_next_misspelling(checker); -+ if (sizeof(test_incorrect) - sizeof(uint16_t) != token.len) { -+ fprintf(stderr, "fail: size of first misspelling (%d) is not what is expected (%lu)\n", -+ token.len, sizeof(test_incorrect) - sizeof(uint16_t)); -+ fail = 1; -+ } else if (memcmp(test_incorrect, (const char *)test_doc + token.offset, token.len) != 0) { -+ fprintf(stderr, "%s", "fail: first misspelling is not what is expected\n"); -+ fail = 1; -+ } -+ if (fail) { -+ printf("not ok\n"); -+ return 1; -+ } else { -+ printf("ok\n"); -+ return 0; -+ } -+} -diff --git a/test/wide_test_valid.c b/test/wide_test_valid.c -new file mode 100644 -index 0000000..bc3006d ---- /dev/null -+++ b/test/wide_test_valid.c -@@ -0,0 +1,69 @@ -+#include -+#include -+#include -+#include -+ -+#include -+ -+const uint16_t test_word[] = {'c','a','f', 0x00E9, 0}; -+const uint16_t test_incorrect[] = {'c','a','f', 'e', 0}; -+const uint16_t test_doc[] = {'T', 'h', 'e', ' ', 'c','a','f', 'e', '.', 0}; -+ -+int fail = 0; -+ -+int main() { -+ AspellConfig * spell_config = new_aspell_config(); -+ aspell_config_replace(spell_config, "master", "en_US-w_accents"); -+ aspell_config_replace(spell_config, "encoding", "ucs-2"); -+ AspellCanHaveError * possible_err = new_aspell_speller(spell_config); -+ AspellSpeller * spell_checker = 0; -+ if (aspell_error_number(possible_err) != 0) { -+ fprintf(stderr, "%s", aspell_error_message(possible_err)); -+ return 2; -+ } else { -+ spell_checker = to_aspell_speller(possible_err); -+ } -+ int correct = aspell_speller_check_w(spell_checker, test_word, -1); -+ if (!correct) { -+ fprintf(stderr, "%s", "fail: expected word to be correct\n"); -+ fail = 1; -+ } -+ correct = aspell_speller_check_w(spell_checker, test_incorrect, -1); -+ if (correct) { -+ fprintf(stderr, "%s", "fail: expected word to be incorrect\n"); -+ fail = 1; -+ } -+ const AspellWordList * suggestions = aspell_speller_suggest_w(spell_checker, test_incorrect, -1); -+ AspellStringEnumeration * elements = aspell_word_list_elements(suggestions); -+ const uint16_t * word = aspell_string_enumeration_next_w(uint16_t, elements); -+ if (memcmp(word, test_word, sizeof(test_incorrect)) != 0) { -+ fprintf(stderr, "%s", "fail: first suggesion is not what is expected\n"); -+ fail = 1; -+ } -+ delete_aspell_string_enumeration(elements); -+ -+ possible_err = new_aspell_document_checker(spell_checker); -+ if (aspell_error(possible_err) != 0) { -+ fprintf(stderr, "Error: %s\n",aspell_error_message(possible_err)); -+ return 2; -+ } -+ AspellDocumentChecker * checker = to_aspell_document_checker(possible_err); -+ aspell_document_checker_process_w(checker, test_doc, -1); -+ -+ AspellToken token = aspell_document_checker_next_misspelling_w(uint16_t, checker); -+ if (4 != token.len) { -+ fprintf(stderr, "fail: size of first misspelling (%d) is not what is expected (%d)\n", -+ token.len, 4); -+ fail = 1; -+ } else if (memcmp(test_incorrect, test_doc + token.offset, token.len) != 0) { -+ fprintf(stderr, "%s", "fail: first misspelling is not what is expected\n"); -+ fail = 1; -+ } -+ if (fail) { -+ printf("not ok\n"); -+ return 1; -+ } else { -+ printf("ok\n"); -+ return 0; -+ } -+} --- -2.27.0 - diff --git a/CVE-2019-20433-2.patch b/CVE-2019-20433-2.patch deleted file mode 100644 index 6d0ee610492e5711058ff6038b913ed60afdff70..0000000000000000000000000000000000000000 --- a/CVE-2019-20433-2.patch +++ /dev/null @@ -1,56 +0,0 @@ -From cefd447e5528b08bb0cd6656bc52b4255692cefc Mon Sep 17 00:00:00 2001 -From: Kevin Atkinson -Date: Sat, 17 Aug 2019 20:25:21 -0400 -Subject: [PATCH] Increment library version to reflect API changes. - ---- - Makefile.am | 24 +++++++++++++++++------- - 1 file changed, 17 insertions(+), 7 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 950319d..3bbadb7 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -93,10 +93,24 @@ libaspell_la_SOURCES =\ - - libaspell_la_LIBADD = $(LTLIBINTL) $(PTHREAD_LIB) - -+## The version string is current[:revision[:age]] -+## -+## Before a release that has changed the source code at all -+## increment revision. -+## -+## After merging changes that have changed the API in a backwards -+## comptable way set revision to 0 and bump both current and age. -+## -+## Do not change the API in a backwards incompatible way. -+## -+## See "Libtool: Updating version info" -+## (https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html) -+## for more into -+## - if INCREMENTED_SONAME --libaspell_la_LDFLAGS = -version-info 16:5:0 -no-undefined -+libaspell_la_LDFLAGS = -version-info 19:0:3 -no-undefined - else --libaspell_la_LDFLAGS = -version-info 16:5:1 -no-undefined -+libaspell_la_LDFLAGS = -version-info 18:0:3 -no-undefined - endif - - if PSPELL_COMPATIBILITY -@@ -104,11 +118,7 @@ libpspell_la_SOURCES = lib/dummy.cpp - - libpspell_la_LIBADD = libaspell.la - --if INCREMENTED_SONAME --libpspell_la_LDFLAGS = -version-info 16:5:0 -no-undefined --else --libpspell_la_LDFLAGS = -version-info 16:5:1 -no-undefined --endif -+libpspell_la_LDFLAGS = $(libaspell_la_LDFLAGS) - - endif - --- -2.27.0 - diff --git a/aspell-0.60.3-install_info.patch b/aspell-0.60.3-install_info.patch deleted file mode 100644 index 34e56363141e2d31e34c102877b0252a70041880..0000000000000000000000000000000000000000 --- a/aspell-0.60.3-install_info.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -up aspell-0.60.6.1/manual/Makefile.in.iinfo aspell-0.60.6.1/manual/Makefile.in ---- aspell-0.60.6.1/manual/Makefile.in.iinfo 2011-07-04 10:58:49.000000000 +0200 -+++ aspell-0.60.6.1/manual/Makefile.in 2011-08-15 16:29:40.999718535 +0200 -@@ -607,16 +607,16 @@ install-info-am: $(INFO_DEPS) - else : ; fi; \ - done; \ - done -- @$(POST_INSTALL) -- @if (install-info --version && \ -- install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ -- list='$(INFO_DEPS)'; \ -- for file in $$list; do \ -- relfile=`echo "$$file" | sed 's|^.*/||'`; \ -- echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ -- install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ -- done; \ -- else : ; fi -+# @$(POST_INSTALL) -+# @if (install-info --version && \ -+# install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ -+# list='$(INFO_DEPS)'; \ -+# for file in $$list; do \ -+# relfile=`echo "$$file" | sed 's|^.*/||'`; \ -+# echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ -+# install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ -+# done; \ -+# else : ; fi - install-man: install-man1 - - install-pdf: install-pdf-am diff --git a/aspell-0.60.5-fileconflict.patch b/aspell-0.60.5-fileconflict.patch deleted file mode 100644 index 08f1fbda1d4a19159385cf02a4802e3495ab55bd..0000000000000000000000000000000000000000 --- a/aspell-0.60.5-fileconflict.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff -up aspell-0.60.6.1/configure.fc aspell-0.60.6.1/configure ---- aspell-0.60.6.1/configure.fc 2011-07-04 10:58:50.000000000 +0200 -+++ aspell-0.60.6.1/configure 2011-08-16 11:28:58.626771599 +0200 -@@ -839,6 +839,7 @@ MAINTAINER_MODE_FALSE - MAINT - pkgdocdir - pkgdatadir -+pkgdatadir2 - pkglibdir - CXX - CXXFLAGS -@@ -2634,18 +2635,21 @@ pkgdatadir=undef - # Check whether --enable-pkgdatadir was given. - if test "${enable_pkgdatadir+set}" = set; then - enableval=$enable_pkgdatadir; pkgdatadir=$enable_pkgdatadir -+ pkgdatadir2=$enable_pkgdatadir - fi - - - # Check whether --enable-pkgdata-dir was given. - if test "${enable_pkgdata_dir+set}" = set; then - enableval=$enable_pkgdata_dir; pkgdatadir=$enable_dict_dir -+ pkgdatadir2=$enable_dict_dir - fi - - - if test "$pkgdatadir" = "undef" - then - pkgdatadir=\${libdir}/aspell-0.60 -+ pkgdatadir2=${exec_prefix}/lib/aspell-0.60:${exec_prefix}/lib64/aspell-0.60 - fi - - -@@ -20119,6 +20123,7 @@ MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_F - MAINT!$MAINT$ac_delim - pkgdocdir!$pkgdocdir$ac_delim - pkgdatadir!$pkgdatadir$ac_delim -+pkgdatadir2!$pkgdatadir2$ac_delim - pkglibdir!$pkglibdir$ac_delim - CXX!$CXX$ac_delim - CXXFLAGS!$CXXFLAGS$ac_delim -@@ -20142,7 +20147,7 @@ ac_ct_CC!$ac_ct_CC$ac_delim - CCDEPMODE!$CCDEPMODE$ac_delim - _ACEOF - -- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then -+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 98; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -diff -up aspell-0.60.6.1/Makefile.in.fc aspell-0.60.6.1/Makefile.in ---- aspell-0.60.6.1/Makefile.in.fc 2011-07-04 10:58:49.000000000 +0200 -+++ aspell-0.60.6.1/Makefile.in 2011-08-16 11:20:09.030887258 +0200 -@@ -344,6 +344,7 @@ distcleancheck_listfiles = find . -type - - # These are needed due to a bug in Automake - pkgdatadir = @pkgdatadir@ -+pkgdatadir2 = @pkgdatadir2@ - pkglibdir = @pkglibdir@ - ACLOCAL = @ACLOCAL@ - AMTAR = @AMTAR@ -@@ -1932,7 +1933,7 @@ gen/dirs.h: gen/mk-dirs_h.pl - cd gen; perl mk-dirs_h.pl ${prefix} ${pkgdatadir} ${pkglibdir} ${sysconfdir} > dirs.h - - scripts/run-with-aspell: scripts/run-with-aspell.create -- sh ${srcdir}/scripts/run-with-aspell.create ${pkgdatadir} > scripts/run-with-aspell -+ sh ${srcdir}/scripts/run-with-aspell.create ${pkgdatadir2} > scripts/run-with-aspell - chmod 755 scripts/run-with-aspell - @PSPELL_COMPATIBILITY_TRUE@scripts/pspell-config: scripts/mkconfig - @PSPELL_COMPATIBILITY_TRUE@ sh ${srcdir}/scripts/mkconfig ${VERSION} ${datadir} ${pkgdatadir} diff --git a/aspell-0.60.6-mp.patch b/aspell-0.60.6-mp.patch deleted file mode 100644 index d7ef3d282c789a33a7c9485a8d6915fc9e715732..0000000000000000000000000000000000000000 --- a/aspell-0.60.6-mp.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -up aspell-0.60.6/manual/aspell.1.pom aspell-0.60.6/manual/aspell.1 ---- aspell-0.60.6/manual/aspell.1.pom 2006-12-19 11:55:08.000000000 +0100 -+++ aspell-0.60.6/manual/aspell.1 2010-08-17 09:42:14.000000000 +0200 -@@ -328,7 +328,6 @@ are also allowed. The \fI/etc/aspell.co - how to set these options and the Aspell Manual has more detailed info. - .SH SEE ALSO - .PP --.BR aspell\-import (1), - .BR prezip\-bin (1), - .BR run\-with\-aspell (1), - .BR word\-list\-compress (1) -diff -up aspell-0.60.6/manual/prezip-bin.1.pom aspell-0.60.6/manual/prezip-bin.1 ---- aspell-0.60.6/manual/prezip-bin.1.pom 2005-10-21 14:18:23.000000000 +0200 -+++ aspell-0.60.6/manual/prezip-bin.1 2010-08-17 09:42:21.000000000 +0200 -@@ -99,7 +99,6 @@ the output file is not complete. - .SH SEE ALSO - .PP - .BR aspell (1), --.BR aspell\-import (1), - .BR run\-with\-aspell (1), - .BR word\-list\-compress (1) - .PP -diff -up aspell-0.60.6/manual/run-with-aspell.1.pom aspell-0.60.6/manual/run-with-aspell.1 ---- aspell-0.60.6/manual/run-with-aspell.1.pom 2004-03-05 05:05:02.000000000 +0100 -+++ aspell-0.60.6/manual/run-with-aspell.1 2010-08-17 09:42:28.000000000 +0200 -@@ -28,7 +28,6 @@ such as ispell's own scripts. - .SH SEE ALSO - .PP - .BR aspell (1), --.BR aspell\-import (1), - .BR word\-list\-compress (1) - .PP - Aspell is fully documented in its Texinfo manual. See the -diff -up aspell-0.60.6/manual/word-list-compress.1.pom aspell-0.60.6/manual/word-list-compress.1 ---- aspell-0.60.6/manual/word-list-compress.1.pom 2005-10-21 14:18:23.000000000 +0200 -+++ aspell-0.60.6/manual/word-list-compress.1 2010-08-17 09:42:35.000000000 +0200 -@@ -80,7 +80,6 @@ be written to. - .SH SEE ALSO - .PP - .BR aspell (1), --.BR aspell\-import (1), - .BR prezip\-bin (1), - .BR run\-with\-aspell (1) - .PP diff --git a/aspell-0.60.6-zero.patch b/aspell-0.60.6-zero.patch deleted file mode 100644 index 11f476d918c4ab0c0eb6276c3b39295b575b89e3..0000000000000000000000000000000000000000 --- a/aspell-0.60.6-zero.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -up aspell-0.60.6/common/convert.cpp.zero aspell-0.60.6/common/convert.cpp ---- aspell-0.60.6/common/convert.cpp.zero 2007-12-03 07:55:45.000000000 +0100 -+++ aspell-0.60.6/common/convert.cpp 2008-09-01 12:04:39.000000000 +0200 -@@ -813,6 +813,7 @@ namespace acommon { - { - ToUniLookup lookup; - void decode(const char * in, int size, FilterCharVector & out) const { -+ if (size == 0) return; // if size == 0 then while loop cause SIGSEGV - const char * stop = in + size; // this is OK even if size == -1 - while (*in && in != stop) { - out.append(from_utf8(in, stop)); diff --git a/aspell-0.60.6.1-aarch64.patch b/aspell-0.60.6.1-aarch64.patch deleted file mode 100644 index 6745e7da1f003b0243241d9fe5d6dfb4f6561318..0000000000000000000000000000000000000000 --- a/aspell-0.60.6.1-aarch64.patch +++ /dev/null @@ -1,1144 +0,0 @@ -diff -urN aspell-0.60.6.1/config.guess aspell-0.60.6.1-aarch64/config.guess ---- aspell-0.60.6.1/config.guess 2011-07-02 16:53:17.000000000 -0500 -+++ aspell-0.60.6.1-aarch64/config.guess 2013-03-07 19:06:06.613457060 -0600 -@@ -1,10 +1,10 @@ - #! /bin/sh - # Attempt to guess a canonical system name. - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, --# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 --# Free Software Foundation, Inc. -+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -+# 2011, 2012 Free Software Foundation, Inc. - --timestamp='2009-11-20' -+timestamp='2012-09-25' - - # This file is free software; you can redistribute it and/or modify it - # under the terms of the GNU General Public License as published by -@@ -17,9 +17,7 @@ - # General Public License for more details. - # - # You should have received a copy of the GNU General Public License --# along with this program; if not, write to the Free Software --# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA --# 02110-1301, USA. -+# along with this program; if not, see . - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a -@@ -56,8 +54,9 @@ - GNU config.guess ($timestamp) - - Originally written by Per Bothner. --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, --2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -+Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -144,7 +143,7 @@ - case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or -- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, -+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward -@@ -180,7 +179,7 @@ - fi - ;; - *) -- os=netbsd -+ os=netbsd - ;; - esac - # The OS release -@@ -201,6 +200,10 @@ - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; -+ *:Bitrig:*:*) -+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` -+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} -+ exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} -@@ -223,7 +226,7 @@ - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) -- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` -+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on -@@ -269,7 +272,10 @@ - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -- exit ;; -+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code. -+ exitcode=$? -+ trap '' 0 -+ exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead -@@ -295,12 +301,12 @@ - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) -- echo powerpc-ibm-os400 -+ echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; -- arm:riscos:*:*|arm:RISCOS:*:*) -+ arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) -@@ -394,23 +400,23 @@ - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) -- echo m68k-atari-mint${UNAME_RELEASE} -+ echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} -- exit ;; -+ exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) -- echo m68k-atari-mint${UNAME_RELEASE} -+ echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) -- echo m68k-milan-mint${UNAME_RELEASE} -- exit ;; -+ echo m68k-milan-mint${UNAME_RELEASE} -+ exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) -- echo m68k-hades-mint${UNAME_RELEASE} -- exit ;; -+ echo m68k-hades-mint${UNAME_RELEASE} -+ exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) -- echo m68k-unknown-mint${UNAME_RELEASE} -- exit ;; -+ echo m68k-unknown-mint${UNAME_RELEASE} -+ exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; -@@ -480,8 +486,8 @@ - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) -- # DG/UX returns AViiON for all architectures -- UNAME_PROCESSOR=`/usr/bin/uname -p` -+ # DG/UX returns AViiON for all architectures -+ UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ -@@ -494,7 +500,7 @@ - else - echo i586-dg-dgux${UNAME_RELEASE} - fi -- exit ;; -+ exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; -@@ -551,7 +557,7 @@ - echo rs6000-ibm-aix3.2 - fi - exit ;; -- *:AIX:*:[456]) -+ *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 -@@ -594,52 +600,52 @@ - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` -- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` -- case "${sc_cpu_version}" in -- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 -- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 -- 532) # CPU_PA_RISC2_0 -- case "${sc_kernel_bits}" in -- 32) HP_ARCH="hppa2.0n" ;; -- 64) HP_ARCH="hppa2.0w" ;; -+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` -+ case "${sc_cpu_version}" in -+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 -+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 -+ 532) # CPU_PA_RISC2_0 -+ case "${sc_kernel_bits}" in -+ 32) HP_ARCH="hppa2.0n" ;; -+ 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 -- esac ;; -- esac -+ esac ;; -+ esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build -- sed 's/^ //' << EOF >$dummy.c -+ sed 's/^ //' << EOF >$dummy.c -+ -+ #define _HPUX_SOURCE -+ #include -+ #include - -- #define _HPUX_SOURCE -- #include -- #include -- -- int main () -- { -- #if defined(_SC_KERNEL_BITS) -- long bits = sysconf(_SC_KERNEL_BITS); -- #endif -- long cpu = sysconf (_SC_CPU_VERSION); -- -- switch (cpu) -- { -- case CPU_PA_RISC1_0: puts ("hppa1.0"); break; -- case CPU_PA_RISC1_1: puts ("hppa1.1"); break; -- case CPU_PA_RISC2_0: -- #if defined(_SC_KERNEL_BITS) -- switch (bits) -- { -- case 64: puts ("hppa2.0w"); break; -- case 32: puts ("hppa2.0n"); break; -- default: puts ("hppa2.0"); break; -- } break; -- #else /* !defined(_SC_KERNEL_BITS) */ -- puts ("hppa2.0"); break; -- #endif -- default: puts ("hppa1.0"); break; -- } -- exit (0); -- } -+ int main () -+ { -+ #if defined(_SC_KERNEL_BITS) -+ long bits = sysconf(_SC_KERNEL_BITS); -+ #endif -+ long cpu = sysconf (_SC_CPU_VERSION); -+ -+ switch (cpu) -+ { -+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break; -+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break; -+ case CPU_PA_RISC2_0: -+ #if defined(_SC_KERNEL_BITS) -+ switch (bits) -+ { -+ case 64: puts ("hppa2.0w"); break; -+ case 32: puts ("hppa2.0n"); break; -+ default: puts ("hppa2.0"); break; -+ } break; -+ #else /* !defined(_SC_KERNEL_BITS) */ -+ puts ("hppa2.0"); break; -+ #endif -+ default: puts ("hppa1.0"); break; -+ } -+ exit (0); -+ } - EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa -@@ -730,22 +736,22 @@ - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd -- exit ;; -+ exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi -- exit ;; -+ exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd -- exit ;; -+ exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd -- exit ;; -+ exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd -- exit ;; -+ exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; -@@ -769,14 +775,14 @@ - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` -- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` -- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -- exit ;; -+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` -+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -+ exit ;; - 5000:UNIX_System_V:4.*:*) -- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` -- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" -+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` -+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` -+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} -@@ -788,30 +794,35 @@ - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) -- case ${UNAME_MACHINE} in -- pc98) -- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ UNAME_PROCESSOR=`/usr/bin/uname -p` -+ case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) -- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; -+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; -+ *:MINGW64*:*) -+ echo ${UNAME_MACHINE}-pc-mingw64 -+ exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; -+ i*:MSYS*:*) -+ echo ${UNAME_MACHINE}-pc-msys -+ exit ;; - i*:windows32*:*) -- # uname -m includes "-pc" on this system. -- echo ${UNAME_MACHINE}-mingw32 -+ # uname -m includes "-pc" on this system. -+ echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) -- case ${UNAME_MACHINE} in -+ case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; -@@ -857,6 +868,13 @@ - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; -+ aarch64:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; -+ aarch64_be:Linux:*:*) -+ UNAME_MACHINE=aarch64_be -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; -@@ -866,7 +884,7 @@ - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; -- esac -+ esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} -@@ -878,20 +896,29 @@ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else -- echo ${UNAME_MACHINE}-unknown-linux-gnueabi -+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ -+ | grep -q __ARM_PCS_VFP -+ then -+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi -+ else -+ echo ${UNAME_MACHINE}-unknown-linux-gnueabihf -+ fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) -- echo cris-axis-linux-gnu -+ echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) -- echo crisv32-axis-linux-gnu -+ echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; - frv:Linux:*:*) -- echo frv-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; -+ hexagon:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu -@@ -933,7 +960,7 @@ - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) -- echo or32-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu -@@ -959,7 +986,7 @@ - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu -@@ -967,14 +994,17 @@ - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; -+ tile*:Linux:*:*) -+ echo ${UNAME_MACHINE}-unknown-linux-gnu -+ exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) -- echo x86_64-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) -- echo ${UNAME_MACHINE}-unknown-linux-gnu -+ echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. -@@ -983,11 +1013,11 @@ - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) -- # Unixware is an offshoot of SVR4, but it has its own version -- # number series starting with 2... -- # I am not positive that other SVR4 systems won't match this, -+ # Unixware is an offshoot of SVR4, but it has its own version -+ # number series starting with 2... -+ # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. -- # Use sysv4.2uw... so that sysv4* matches it. -+ # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) -@@ -1019,7 +1049,7 @@ - fi - exit ;; - i*86:*:5:[678]*) -- # UnixWare 7.x, OpenUNIX and OpenServer 6. -+ # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; -@@ -1047,13 +1077,13 @@ - exit ;; - pc:*:*:*) - # Left here for compatibility: -- # uname -m prints for DJGPP always 'pc', but it prints nothing about -- # the processor, so we play safe by assuming i586. -+ # uname -m prints for DJGPP always 'pc', but it prints nothing about -+ # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp -- exit ;; -+ exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; -@@ -1088,8 +1118,8 @@ - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) -- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -- && { echo i486-ncr-sysv4; exit; } ;; -+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ -+ && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ -@@ -1132,10 +1162,10 @@ - echo ns32k-sni-sysv - fi - exit ;; -- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort -- # says -- echo i586-unisys-sysv4 -- exit ;; -+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort -+ # says -+ echo i586-unisys-sysv4 -+ exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm -@@ -1161,11 +1191,11 @@ - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then -- echo mips-nec-sysv${UNAME_RELEASE} -+ echo mips-nec-sysv${UNAME_RELEASE} - else -- echo mips-unknown-sysv${UNAME_RELEASE} -+ echo mips-unknown-sysv${UNAME_RELEASE} - fi -- exit ;; -+ exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; -@@ -1178,6 +1208,9 @@ - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; -+ x86_64:Haiku:*:*) -+ echo x86_64-unknown-haiku -+ exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; -@@ -1230,7 +1263,10 @@ - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; -- NSE-?:NONSTOP_KERNEL:*:*) -+ NEO-?:NONSTOP_KERNEL:*:*) -+ echo neo-tandem-nsk${UNAME_RELEASE} -+ exit ;; -+ NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) -@@ -1275,13 +1311,13 @@ - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) -- echo mips-sei-seiux${UNAME_RELEASE} -+ echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) -- UNAME_MACHINE=`(uname -p) 2>/dev/null` -+ UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; -@@ -1299,11 +1335,11 @@ - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -+ x86_64:VMkernel:*:*) -+ echo ${UNAME_MACHINE}-unknown-esx -+ exit ;; - esac - --#echo '(No uname command or uname output not recognized.)' 1>&2 --#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 -- - eval $set_cc_for_build - cat >$dummy.c < - printf ("m68k-sony-newsos%s\n", - #ifdef NEWSOS4 -- "4" -+ "4" - #else -- "" -+ "" - #endif -- ); exit (0); -+ ); exit (0); - #endif - #endif - -diff -urN aspell-0.60.6.1/config.sub aspell-0.60.6.1-aarch64/config.sub ---- aspell-0.60.6.1/config.sub 2011-07-02 16:53:17.000000000 -0500 -+++ aspell-0.60.6.1-aarch64/config.sub 2013-03-07 19:06:06.651452728 -0600 -@@ -1,10 +1,10 @@ - #! /bin/sh - # Configuration validation subroutine script. - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, --# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 --# Free Software Foundation, Inc. -+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -+# 2011, 2012 Free Software Foundation, Inc. - --timestamp='2009-11-20' -+timestamp='2012-10-10' - - # This file is (in principle) common to ALL GNU software. - # The presence of a machine in this file suggests that SOME GNU software -@@ -21,9 +21,7 @@ - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License --# along with this program; if not, write to the Free Software --# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA --# 02110-1301, USA. -+# along with this program; if not, see . - # - # As a special exception to the GNU General Public License, if you - # distribute this file as part of a program that contains a -@@ -75,8 +73,9 @@ - version="\ - GNU config.sub ($timestamp) - --Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, --2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -+Free Software Foundation, Inc. - - This is free software; see the source for copying conditions. There is NO - warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -@@ -123,13 +122,18 @@ - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in -- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ -- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ -+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ -+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ -+ knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; -+ android-linux) -+ os=-linux-android -+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown -+ ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] -@@ -152,12 +156,12 @@ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -- -apple | -axis | -knuth | -cray | -microblaze) -+ -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; -- -bluegene*) -- os=-cnk -+ -bluegene*) -+ os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= -@@ -173,10 +177,10 @@ - os=-chorusos - basic_machine=$1 - ;; -- -chorusrdb) -- os=-chorusrdb -+ -chorusrdb) -+ os=-chorusrdb - basic_machine=$1 -- ;; -+ ;; - -hiux*) - os=-hiuxwe2 - ;; -@@ -221,6 +225,12 @@ - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; -+ -lynx*178) -+ os=-lynxos178 -+ ;; -+ -lynx*5) -+ os=-lynxos5 -+ ;; - -lynx*) - os=-lynxos - ;; -@@ -245,20 +255,25 @@ - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ -+ | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ -+ | be32 | be64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ -+ | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ -+ | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ -+ | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ -- | maxq | mb | microblaze | mcore | mep | metag \ -+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ -@@ -281,29 +296,39 @@ - | moxie \ - | mt \ - | msp430 \ -+ | nds32 | nds32le | nds32be \ - | nios | nios2 \ - | ns16k | ns32k \ -+ | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ -- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ -+ | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ -- | rx \ -+ | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ -- | spu | strongarm \ -- | tahoe | thumb | tic4x | tic80 | tron \ -+ | spu \ -+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ -- | v850 | v850e \ -+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ -- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ -+ | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; -- m6811 | m68hc11 | m6812 | m68hc12 | picochip) -- # Motorola 68HC11/12. -+ c54x) -+ basic_machine=tic54x-unknown -+ ;; -+ c55x) -+ basic_machine=tic55x-unknown -+ ;; -+ c6x) -+ basic_machine=tic6x-unknown -+ ;; -+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; -@@ -313,6 +338,21 @@ - basic_machine=mt-unknown - ;; - -+ strongarm | thumb | xscale) -+ basic_machine=arm-unknown -+ ;; -+ xgate) -+ basic_machine=$basic_machine-unknown -+ os=-none -+ ;; -+ xscaleeb) -+ basic_machine=armeb-unknown -+ ;; -+ -+ xscaleel) -+ basic_machine=armel-unknown -+ ;; -+ - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. -@@ -327,25 +367,30 @@ - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ -+ | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ -+ | be32-* | be64-* \ - | bfin-* | bs2000-* \ -- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ -+ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ -+ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ -+ | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ -- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ -+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ -+ | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ -@@ -367,25 +412,29 @@ - | mmix-* \ - | mt-* \ - | msp430-* \ -+ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ -+ | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ -- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ -+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ -- | romp-* | rs6000-* | rx-* \ -+ | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ -- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ -- | tahoe-* | thumb-* \ -- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ -+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ -+ | tahoe-* \ -+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ -+ | tile*-* \ - | tron-* \ - | ubicom32-* \ -- | v850-* | v850e-* | vax-* \ -+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ -+ | vax-* \ - | we32k-* \ -- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ -+ | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) -@@ -410,7 +459,7 @@ - basic_machine=a29k-amd - os=-udi - ;; -- abacus) -+ abacus) - basic_machine=abacus-unknown - ;; - adobe68k) -@@ -480,11 +529,20 @@ - basic_machine=powerpc-ibm - os=-cnk - ;; -+ c54x-*) -+ basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; -+ c55x-*) -+ basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; -+ c6x-*) -+ basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; -- cegcc) -+ cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; -@@ -516,7 +574,7 @@ - basic_machine=craynv-cray - os=-unicosmp - ;; -- cr16) -+ cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; -@@ -674,7 +732,6 @@ - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; --# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 -@@ -732,9 +789,13 @@ - basic_machine=ns32k-utek - os=-sysv - ;; -- microblaze) -+ microblaze*) - basic_machine=microblaze-xilinx - ;; -+ mingw64) -+ basic_machine=x86_64-pc -+ os=-mingw64 -+ ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 -@@ -771,10 +832,18 @@ - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; -+ msys) -+ basic_machine=i386-pc -+ os=-msys -+ ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; -+ nacl) -+ basic_machine=le32-unknown -+ os=-nacl -+ ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 -@@ -839,6 +908,12 @@ - np1) - basic_machine=np1-gould - ;; -+ neo-tandem) -+ basic_machine=neo-tandem -+ ;; -+ nse-tandem) -+ basic_machine=nse-tandem -+ ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; -@@ -921,9 +996,10 @@ - ;; - power) basic_machine=power-ibm - ;; -- ppc) basic_machine=powerpc-unknown -+ ppc | ppcbe) basic_machine=powerpc-unknown - ;; -- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ppc-* | ppcbe-*) -+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown -@@ -1017,6 +1093,9 @@ - basic_machine=i860-stratus - os=-sysv4 - ;; -+ strongarm-* | thumb-*) -+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - sun2) - basic_machine=m68000-sun - ;; -@@ -1073,20 +1152,8 @@ - basic_machine=t90-cray - os=-unicos - ;; -- tic54x | c54x*) -- basic_machine=tic54x-unknown -- os=-coff -- ;; -- tic55x | c55x*) -- basic_machine=tic55x-unknown -- os=-coff -- ;; -- tic6x | c6x*) -- basic_machine=tic6x-unknown -- os=-coff -- ;; - tile*) -- basic_machine=tile-unknown -+ basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) -@@ -1156,6 +1223,9 @@ - xps | xps100) - basic_machine=xps100-honeywell - ;; -+ xscale-* | xscalee[bl]-*) -+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` -+ ;; - ymp) - basic_machine=ymp-cray - os=-unicos -@@ -1253,11 +1323,11 @@ - if [ x"$os" != x"" ] - then - case $os in -- # First match some system type aliases -- # that might get confused with valid system types. -+ # First match some system type aliases -+ # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. -- -auroraux) -- os=-auroraux -+ -auroraux) -+ os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` -@@ -1287,14 +1357,15 @@ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ -- | -openbsd* | -solidbsd* \ -+ | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ -- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ -- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ -+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ -+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ -+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ -@@ -1341,7 +1412,7 @@ - -opened*) - os=-openedition - ;; -- -os400*) -+ -os400*) - os=-os400 - ;; - -wince*) -@@ -1390,7 +1461,7 @@ - -sinix*) - os=-sysv4 - ;; -- -tpf*) -+ -tpf*) - os=-tpf - ;; - -triton*) -@@ -1435,6 +1506,8 @@ - -dicos*) - os=-dicos - ;; -+ -nacl*) -+ ;; - -none) - ;; - *) -@@ -1457,10 +1530,10 @@ - # system, and we'll never get to this point. - - case $basic_machine in -- score-*) -+ score-*) - os=-elf - ;; -- spu-*) -+ spu-*) - os=-elf - ;; - *-acorn) -@@ -1472,8 +1545,20 @@ - arm*-semi) - os=-aout - ;; -- c4x-* | tic4x-*) -- os=-coff -+ c4x-* | tic4x-*) -+ os=-coff -+ ;; -+ hexagon-*) -+ os=-elf -+ ;; -+ tic54x-*) -+ os=-coff -+ ;; -+ tic55x-*) -+ os=-coff -+ ;; -+ tic6x-*) -+ os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) -@@ -1493,14 +1578,11 @@ - ;; - m68000-sun) - os=-sunos3 -- # This also exists in the configure program, but was not the -- # default. -- # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; -- mep-*) -+ mep-*) - os=-elf - ;; - mips*-cisco) -@@ -1527,7 +1609,7 @@ - *-ibm) - os=-aix - ;; -- *-knuth) -+ *-knuth) - os=-mmixware - ;; - *-wec) diff --git a/aspell-0.60.6.1-dump-personal-abort.patch b/aspell-0.60.6.1-dump-personal-abort.patch deleted file mode 100644 index 6aa982f1bcfc8697100ffdf12c867b0c806ff15f..0000000000000000000000000000000000000000 --- a/aspell-0.60.6.1-dump-personal-abort.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -upr aspell-0.60.6.1.orig/prog/aspell.cpp aspell-0.60.6.1/prog/aspell.cpp ---- aspell-0.60.6.1.orig/prog/aspell.cpp 2011-07-04 11:13:58.000000000 +0200 -+++ aspell-0.60.6.1/prog/aspell.cpp 2012-07-19 15:16:43.204799622 +0200 -@@ -1570,7 +1570,8 @@ void personal () { - - Config * config = options; - Dictionary * per = new_default_writable_dict(); -- per->load(config->retrieve("personal-path"), *config); -+ PosibErr pe = per->load(config->retrieve("personal-path"), *config); -+ if (pe.has_err()) {print_error(pe.get_err()->mesg); exit(1);} - StackPtr els(per->detailed_elements()); - StackPtr conv(setup_conv(per->lang(), config)); - diff --git a/aspell-0.60.6.1-fix-back-on-empty-vector.patch b/aspell-0.60.6.1-fix-back-on-empty-vector.patch deleted file mode 100644 index f41db9bb6c102df5b7f7f98e1adafd6f69712180..0000000000000000000000000000000000000000 --- a/aspell-0.60.6.1-fix-back-on-empty-vector.patch +++ /dev/null @@ -1,38 +0,0 @@ -From c6755a399e8a31cbee5129dde5124f9c54a47ab6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Nikola=20Forr=C3=B3?= -Date: Wed, 4 Apr 2018 14:58:03 +0200 -Subject: [PATCH] Do not call back() on an empty vector -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Calling std::vector::back() on an empty container is undefined. -Avoid doing that, simply return pointer to the beginning in case -the vector is empty. - -Signed-off-by: Nikola Forró ---- - common/vector.hpp | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/common/vector.hpp b/common/vector.hpp -index 782e4b0..cb344bd 100644 ---- a/common/vector.hpp -+++ b/common/vector.hpp -@@ -36,13 +36,13 @@ namespace acommon - } - T * data() {return &*this->begin();} - T * data(int pos) {return &*this->begin() + pos;} -- T * data_end() {return &this->back()+1;} -+ T * data_end() {return this->empty() ? &*this->begin() : &this->back()+1;} - - T * pbegin() {return &*this->begin();} -- T * pend() {return &this->back()+1;} -+ T * pend() {return this->empty() ? &*this->begin() : &this->back()+1;} - - const T * pbegin() const {return &*this->begin();} -- const T * pend() const {return &this->back()+1;} -+ const T * pend() const {return this->empty() ? &*this->begin() : &this->back()+1;} - - template - U * datap() { diff --git a/aspell-0.60.6.1-gcc7-fixes.patch b/aspell-0.60.6.1-gcc7-fixes.patch deleted file mode 100644 index 4eb825a24958e2774424dba04e670d80b8b8f025..0000000000000000000000000000000000000000 --- a/aspell-0.60.6.1-gcc7-fixes.patch +++ /dev/null @@ -1,34 +0,0 @@ -commit 8089fa02122fed0a6394eba14bbedcb1d18e2384 -Author: Kevin Atkinson -Date: Thu Dec 29 00:50:31 2016 -0500 - - Compile Fixes for GCC 7. - - Closes #519. - -diff --git a/modules/filter/tex.cpp b/modules/filter/tex.cpp -index a979539..19ab63c 100644 ---- a/modules/filter/tex.cpp -+++ b/modules/filter/tex.cpp -@@ -174,7 +174,7 @@ namespace { - - if (c == '{') { - -- if (top.in_what == Parm || top.in_what == Opt || top.do_check == '\0') -+ if (top.in_what == Parm || top.in_what == Opt || *top.do_check == '\0') - push_command(Parm); - - top.in_what = Parm; -diff --git a/prog/check_funs.cpp b/prog/check_funs.cpp -index db54f3d..89ee09d 100644 ---- a/prog/check_funs.cpp -+++ b/prog/check_funs.cpp -@@ -647,7 +647,7 @@ static void print_truncate(FILE * out, const char * word, int width) { - } - } - if (i == width-1) { -- if (word == '\0') -+ if (*word == '\0') - put(out,' '); - else if (word[len] == '\0') - put(out, word, len); diff --git a/aspell-0.60.6.1.tar.gz b/aspell-0.60.6.1.tar.gz deleted file mode 100644 index 45c12e24c6854a1a215463db6a959056813cf2f9..0000000000000000000000000000000000000000 Binary files a/aspell-0.60.6.1.tar.gz and /dev/null differ diff --git a/aspell-0.60.5-pspell_conf.patch b/aspell-0.60.8-pspell_conf.patch similarity index 100% rename from aspell-0.60.5-pspell_conf.patch rename to aspell-0.60.8-pspell_conf.patch diff --git a/aspell-0.60.8.tar.gz b/aspell-0.60.8.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7e4b7664c20017f471dd66a7730d2812c0a880d8 Binary files /dev/null and b/aspell-0.60.8.tar.gz differ diff --git a/aspell.spec b/aspell.spec index 3d8439388d670dc1e9a79e1fc512abcc0da456eb..fc0269687ecdf2c3198eadf6e2693f1e2ac8c195 100644 --- a/aspell.spec +++ b/aspell.spec @@ -1,25 +1,14 @@ Name: aspell -Version: 0.60.6.1 -Release: 29 +Version: 0.60.8 +Release: 1 Summary: Spell checker Epoch: 12 License: LGPLv2+ and LGPLv2 and GPLv2+ and BSD URL: http://aspell.net/ Source: http://mirrors.ustc.edu.cn/gnu/aspell/aspell-%{version}.tar.gz -Patch0000: aspell-0.60.3-install_info.patch -Patch0001: aspell-0.60.5-fileconflict.patch -Patch0002: aspell-0.60.5-pspell_conf.patch -Patch0003: aspell-0.60.6-zero.patch -Patch0004: aspell-0.60.6-mp.patch -Patch0005: aspell-0.60.6.1-dump-personal-abort.patch -Patch0006: aspell-0.60.6.1-aarch64.patch -Patch0007: aspell-0.60.6.1-gcc7-fixes.patch -Patch0008: aspell-0.60.6.1-fix-back-on-empty-vector.patch -Patch0009: CVE-2019-17544.patch -Patch0010: CVE-2019-25051.patch -Patch0011: CVE-2019-20433-1.patch -Patch0012: CVE-2019-20433-2.patch +Patch0000: aspell-0.60.8-pspell_conf.patch +Patch0001: CVE-2019-25051.patch BuildRequires: chrpath gettext ncurses-devel pkgconfig perl-interpreter gcc-c++ @@ -91,6 +80,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_mandir}/man1/aspell-import.1 %{_libdir}/lib*.so.* %{_libdir}/aspell-0.60/* %{_infodir}/aspell.* +%{_infodir}/dir %exclude %{_libdir}/libaspell.la %exclude %{_libdir}/libpspell.la %exclude %{_libdir}/aspell-0.60/*-filter.la @@ -114,13 +104,16 @@ rm -rf ${RPM_BUILD_ROOT}%{_mandir}/man1/aspell-import.1 %{_mandir}/man1/pspell-config.1* %changelog +* Tue Jun 21 2022 yangzhao - 12:0.60.8-1 +- Upgrade to version 0.60.8 + * Tue Sep 28 2021 yaoxin - 12:0.60.6.1-29 - fix CVE-2019-20433 * Thu Sep 23 2021 liwu - 12:0.60.6.1-28 - fix CVE-2019-25051 -* Thu Jul 27 2021 houyingchao - 12:0.60.6.1-27 +* Tue Jul 27 2021 houyingchao - 12:0.60.6.1-27 - fix CVE-2019-17544 * Thu Dec 24 2020 Ge Wang - 12:0.60.6.1-26