summary refs log tree commit diff
path: root/pkgs/applications/science/math/pari
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2019-03-05 20:23:30 +0100
committerTimo Kaufmann <timokau@zoho.com>2019-03-05 21:50:44 +0100
commita648b8c7143f444c04a0a35d458996dadcce3dc4 (patch)
tree18ae477c99dead2527afae5783cd3d7c76831d04 /pkgs/applications/science/math/pari
parent00fa98f0122be32ca6daa5d187472c83a90a7e74 (diff)
downloadnixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.tar
nixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.tar.gz
nixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.tar.bz2
nixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.tar.lz
nixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.tar.xz
nixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.tar.zst
nixpkgs-a648b8c7143f444c04a0a35d458996dadcce3dc4.zip
pari: fix off-by-one error
Done by applying upstream patch. Will be included in the next release.

Upstream: https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2117
Diffstat (limited to 'pkgs/applications/science/math/pari')
-rw-r--r--pkgs/applications/science/math/pari/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix
index 0291cbb42cf..72827112c50 100644
--- a/pkgs/applications/science/math/pari/default.nix
+++ b/pkgs/applications/science/math/pari/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchurl
+, fetchpatch
 , gmp
 , readline
 , libX11
@@ -19,6 +20,18 @@ stdenv.mkDerivation rec {
     sha256 = "1jfax92jpydjd02fwl30r6b8kfzqqd6sm4yx94gidyz9lqjb7a94";
   };
 
+  patches = [
+    # Fix a off-by-one bug that can potentially lead to segfaults (accepted upstream)
+    # https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2117
+    # https://trac.sagemath.org/ticket/27335
+    (fetchpatch {
+      name = "fix-off-by-one-error.patch";
+      # only relevant parts of https://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=patch;h=aa1ee6e0898d177e6bcf49237d82c804bc410985
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pari/patches/red_montgomery.patch?id=bbea55c96e1f05302b3c7f593cf64492497047c5";
+      sha256 = "0vqkmhgv9splsdswp6zjnkj50z76rc1m6k9iy3cf9dxwqw3h3nr6";
+    })
+  ];
+
   buildInputs = [
     gmp
     readline