Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugin: cherrypick fix for segfault on empty XDG_DATA_DIR #204740

Merged
merged 1 commit into from Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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())