After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 576558 - Crashes when trying to save write protected file
Crashes when trying to save write protected file
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Normal critical
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-24 12:25 UTC by Josselin Mouette
Modified: 2009-03-24 15:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Properly pass the GError (517 bytes, patch)
2009-03-24 12:26 UTC, Josselin Mouette
none Details | Review

Description Josselin Mouette 2009-03-24 12:25:16 UTC
[ Original report: http://bugs.debian.org/507991 by Matthias Bläsing ]

To get this trace I did this:

Placed tuz.png on the desktop, remove the write permission for me and
opened it in eog, rotated it left by 90° and pressed CTRL-S to save the
resulting image.

Program received signal SIGSEGV, Segmentation fault.

Thread 3061484432 (LWP 5410)

  • #0 tmp_file_move_to_uri
    at eog-image.c line 1339
  • #1 eog_image_save_by_info
    at eog-image.c line 1501
  • #2 eog_job_save_real_run
    at eog-jobs.c line 569
  • #3 eog_job_save_run
    at eog-jobs.c line 590
  • #4 eog_render_thread
    at eog-job-queue.c line 84
  • #5 g_thread_create_proxy
  • #6 start_thread
    from /lib/libpthread.so.0
  • #7 clone
    from /lib/libc.so.6

Comment 1 Josselin Mouette 2009-03-24 12:26:58 UTC
Created attachment 131251 [details] [review]
Properly pass the GError

My understanding is that it is caused by dereferencing NULL in g_error_matches.

Passing correctly the GError pointer to g_file_move should do the trick.
Comment 2 Felix Riemann 2009-03-24 15:00:17 UTC
Okay, I assume your Desktop folder permissions are different than mine, as g_file_move happily overwrites the file here (ignoring the file permission, bug 320688).

But yes, you're right, the GError handling is wrong here and leads to a crash. I added the remaining parts to your patch and committed it.

2009-03-24  Felix Riemann  <>

	* src/eog-image.c: (tmp_file_move_to_uri): Fix GError usage and avoid
	crashes when the tempfile can't be moved to the destination.
	Fixes bug #576558 (Josselin Mouette, Felix Riemann).

This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.