Commit 7288e9a
smpl-os
libnemo-private: fix use-after-free crash in nemo_file_mark_gone
nemo_directory_remove_file() calls nemo_file_unref() when the directory
is monitoring its file list. If the caller holds no extra ref, this can
drop the refcount to zero and free the NemoFile object. The
nemo_file_clear_info() call immediately after then dereferences the
freed pointer, causing a SIGSEGV.
Fix: take a temporary ref before the if-block so the object stays alive
through both nemo_directory_remove_file() and nemo_file_clear_info(),
and release it only after both calls complete.
Closes #37121 parent 58846d5 commit 7288e9a
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7947 | 7947 | | |
7948 | 7948 | | |
7949 | 7949 | | |
| 7950 | + | |
| 7951 | + | |
| 7952 | + | |
| 7953 | + | |
| 7954 | + | |
| 7955 | + | |
7950 | 7956 | | |
7951 | 7957 | | |
7952 | 7958 | | |
7953 | 7959 | | |
7954 | 7960 | | |
| 7961 | + | |
7955 | 7962 | | |
7956 | 7963 | | |
7957 | 7964 | | |
| |||
0 commit comments