summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file.c
diff options
context:
space:
mode:
authorMichael Catanzaro <[email protected]>2013-11-06 21:53:45 -0600
committerlukefromdc <[email protected]>2018-11-02 00:01:17 -0400
commitd8d375b51c623231f163e341c036cdea56c00c4a (patch)
treea7dd07c7d82bfc55270516f2b3f794ba5250cf21 /libcaja-private/caja-file.c
parentae033ba522d6f3f3047e3886b4567464babab3a0 (diff)
downloadcaja-d8d375b51c623231f163e341c036cdea56c00c4a.tar.bz2
caja-d8d375b51c623231f163e341c036cdea56c00c4a.tar.xz
CajaFile: fix crash in modify_link_hash_table
We crash in g_hash_table_lookup_extended if the file's symlink_name is set but the file is not a symlink, since the hash function (g_str_hash) does not allow NULL values but target_uri is NULL. https://bugzilla.gnome.org/show_bug.cgi?id=711583 Adapted from https://gitlab.gnome.org/GNOME/nautilus/commit/c2a5e052
Diffstat (limited to 'libcaja-private/caja-file.c')
-rw-r--r--libcaja-private/caja-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index 3f228b0a..0d13ff5f 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -555,7 +555,7 @@ modify_link_hash_table (CajaFile *file,
GList **list_ptr;
/* Check if there is a symlink name. If none, we are OK. */
- if (file->details->symlink_name == NULL) {
+ if (file->details->symlink_name == NULL || !caja_file_is_symbolic_link (file)) {
return;
}