diff options
author | madpilot <madpilot@FreeBSD.org> | 2018-02-22 19:56:45 +0800 |
---|---|---|
committer | madpilot <madpilot@FreeBSD.org> | 2018-02-22 19:56:45 +0800 |
commit | 64428ff93ff3255b09474a36ebb7a85f06b5ff56 (patch) | |
tree | 80184e49f1933c604c3e815f86847ec2fd3ad150 /x11-fm/thunar | |
parent | a0107c7c1aed4d9d42dabf81aaad71117cb9520a (diff) | |
download | freebsd-ports-gnome-64428ff93ff3255b09474a36ebb7a85f06b5ff56.tar.gz freebsd-ports-gnome-64428ff93ff3255b09474a36ebb7a85f06b5ff56.tar.zst freebsd-ports-gnome-64428ff93ff3255b09474a36ebb7a85f06b5ff56.zip |
Add patches to thunar from upstream bug report to mitigate crash
when renaming files.
The patch replaces some calls to strcmp() which are sometimes getting
NULL pointers, causing a crash, with safe calls to g_strcmp0()
calls, which handle NULL pointers gracefully.
I'm also adding a patch in another code path checking for a pointer
to actually point to the correct structure and not being NULL.
These patches seem to actually prevent the reported crash from
happening.
PR: 217946
Submitted by: Marko Cupac <marko.cupac@mimar.rs>
Obtained from: https://bugzilla.xfce.org/show_bug.cgi?id=12264
Diffstat (limited to 'x11-fm/thunar')
-rw-r--r-- | x11-fm/thunar/Makefile | 1 | ||||
-rw-r--r-- | x11-fm/thunar/files/patch-thunar_thunar-file.c | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/x11-fm/thunar/Makefile b/x11-fm/thunar/Makefile index 3d550b41794c..0e6f255fd643 100644 --- a/x11-fm/thunar/Makefile +++ b/x11-fm/thunar/Makefile @@ -3,6 +3,7 @@ PORTNAME= Thunar DISTVERSION= 1.6.14 +PORTREVISION= 1 CATEGORIES= x11-fm xfce MASTER_SITES= XFCE/src/xfce/${PORTNAME:tl}/${PORTVERSION:R} DIST_SUBDIR= xfce4 diff --git a/x11-fm/thunar/files/patch-thunar_thunar-file.c b/x11-fm/thunar/files/patch-thunar_thunar-file.c new file mode 100644 index 000000000000..baa23b7c7bb5 --- /dev/null +++ b/x11-fm/thunar/files/patch-thunar_thunar-file.c @@ -0,0 +1,27 @@ +--- thunar/thunar-file.c.orig 2017-11-25 16:54:56 UTC ++++ thunar/thunar-file.c +@@ -3966,7 +3966,9 @@ thunar_file_unwatch (ThunarFile *file) + gboolean + thunar_file_reload (ThunarFile *file) + { +- _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); ++ /* if the file has already been destroyed, break here */ ++ if (!THUNAR_IS_FILE (file)) ++ return FALSE; + + /* clear file pxmap cache */ + thunar_icon_factory_clear_pixmap_cache (file); +@@ -4090,11 +4092,11 @@ thunar_file_compare_by_name (const ThunarFile *file_a, + + /* case insensitive checking */ + if (G_LIKELY (!case_sensitive)) +- result = strcmp (file_a->collate_key_nocase, file_b->collate_key_nocase); ++ result = g_strcmp0 (file_a->collate_key_nocase, file_b->collate_key_nocase); + + /* fall-back to case sensitive */ + if (result == 0) +- result = strcmp (file_a->collate_key, file_b->collate_key); ++ result = g_strcmp0 (file_a->collate_key, file_b->collate_key); + + /* this happens in the trash */ + if (result == 0) |