Skip to content

Commit

Permalink
openexr_2: fix CVE-2021-3933, enable tests
Browse files Browse the repository at this point in the history
Signed-off-by: Henri Rosten <henri.rosten@unikie.com>
  • Loading branch information
henrirosten committed May 29, 2023
1 parent a048bbb commit e6d6adc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkgs/development/libraries/openexr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,29 @@ stdenv.mkDerivation rec {
extraPrefix = "OpenEXR/IlmImf/";
sha256 = "1wa2jn6sa0n3phaqvklnlbgk1bz60y756ad4jk4d757pzpnannsy";
})
(fetchpatch {
name = "CVE-2021-3933.patch";
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/5db6f7aee79e3e75e8c3780b18b28699614dd08e.patch";
stripLen = 4;
extraPrefix = "OpenEXR/IlmImf/";
sha256 = "sha256-DrpldpNgN5pWKzIuuPIrynGX3EpP8YhJlu+lLfNFGxQ=";
})
];

# tests are determined to use /var/tmp on unix
postPatch = ''
find . -name tmpDir.h | while read -r f ; do
substituteInPlace $f --replace '/var/tmp' "$TMPDIR"
done
'';

cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";

nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ ilmbase zlib ];

doCheck = true;

meta = with lib; {
description = "A high dynamic-range (HDR) image file format";
homepage = "https://www.openexr.com/";
Expand Down

0 comments on commit e6d6adc

Please sign in to comment.