From b2c07a1a290a22ab202b7f140122b9382edf0f27 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sun, 22 Aug 2021 17:37:13 +0100 Subject: [PATCH] cpio: add patch for CVE-2021-38185 --- pkgs/tools/archivers/cpio/default.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix index 5b88e10b1c37..c172edd1fd98 100644 --- a/pkgs/tools/archivers/cpio/default.nix +++ b/pkgs/tools/archivers/cpio/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl }: +{ lib, stdenv, fetchurl, fetchpatch }: let version = "2.13"; @@ -11,6 +11,14 @@ in stdenv.mkDerivation { sha256 = "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga"; }; + patches = [ + (fetchpatch { + name = "CVE-2021-38185.patch"; + url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=dd96882877721703e19272fe25034560b794061b"; + sha256 = "0vmr0qjwj2ldnzsvccl105ckwgx3ssvn9mp3f27ss0kiyigrzz32"; + }) + ]; + preConfigure = if stdenv.isCygwin then '' sed -i gnu/fpending.h -e 's,include ,,' '' else null;