diff --git a/encodeoffbyone.diff b/encodeoffbyone.diff new file mode 100644 index 0000000..9755ee9 --- /dev/null +++ b/encodeoffbyone.diff @@ -0,0 +1,11 @@ +--- ./lib/Net/IDN/Punycode.xs.orig 2014-07-22 13:54:38.988433322 +0000 ++++ ./lib/Net/IDN/Punycode.xs 2014-07-22 13:59:25.217074100 +0000 +@@ -138,7 +138,7 @@ encode_punycode(input) + q = delta; + + for(k = BASE;; k += BASE) { +- if(re_p >= re_e) { ++ if(re_p + 1 >= re_e) { + length_guess = re_e - re_s + 16; + re_e = SvGROW(RETVAL, length_guess); + re_p = re_e + (re_p - re_s); diff --git a/perl-Net-IDN-Encode.changes b/perl-Net-IDN-Encode.changes index d976660..741ec56 100644 --- a/perl-Net-IDN-Encode.changes +++ b/perl-Net-IDN-Encode.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 22 16:00:29 CEST 2014 - mls@suse.de + +- fix off-by-one error in memory allocation in the punycode encoder + new patch: encodeoffbyone.diff + ------------------------------------------------------------------- Sun Jul 20 07:29:18 UTC 2014 - coolo@suse.com diff --git a/perl-Net-IDN-Encode.spec b/perl-Net-IDN-Encode.spec index a59bb3d..b5e39d2 100644 --- a/perl-Net-IDN-Encode.spec +++ b/perl-Net-IDN-Encode.spec @@ -25,6 +25,7 @@ License: Artistic-1.0 or GPL-1.0+ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/Net-IDN-Encode/ Source: http://www.cpan.org/authors/id/C/CF/CFAERBER/%{cpan_name}-%{version}.tar.gz +Patch: encodeoffbyone.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: perl BuildRequires: perl-macros @@ -47,6 +48,7 @@ addresses), using whatever IDNA standard is the best choice at the moment. %prep %setup -q -n %{cpan_name}-%{version} +%patch find . -type f -print0 | xargs -0 chmod 644 %build