Skip to content

Commit

Permalink
Merge pull request #204740 from amjoseph-nixpkgs/hugin1
Browse files Browse the repository at this point in the history
hugin: cherrypick fix for segfault on empty XDG_DATA_DIR
  • Loading branch information
Artturin authored Dec 10, 2022
2 parents d38dc84 + ccdfaa8 commit 790020f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/applications/graphics/hugin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-BHrqin+keESzTvJ8GdO2l+hJOdyx/bvrLCBGIbZu6tk=";
};

patches = [
# committed upstream but unreleased:
# https://sourceforge.net/p/hugin/hugin/ci/edfddc6070ca6d4223d359fb4b38273a5aed2f2d
./dont-crash-if-XDG_DATA_DIRS-not-set-edfddc6070ca6d4223d359fb4b38273a5aed2f2d.patch
];

buildInputs = [
boost
cairo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/src/hugin_base/hugin_utils/utils.cpp 2022-12-05 22:19:26.873574924 -0800
+++ b/src/hugin_base/hugin_utils/utils.cpp 2022-12-05 22:19:09.069575641 -0800
@@ -472,9 +472,9 @@
#else
#ifdef USE_XDG_DIRS
char *xdgDataDir = getenv("XDG_DATA_HOME");
- if (strlen(xdgDataDir) == 0)
+ if (xdgDataDir == NULL || strlen(xdgDataDir) == 0)
{
- // no XDG_DATA_HOME enviroment variable set
+ // no XDG_DATA_HOME enviroment variable set or empty variable
// use $HOME/.local/share instead
const std::string homeDir = GetHomeDir();
if (homeDir.empty())

0 comments on commit 790020f

Please sign in to comment.