GNOME Bugzilla – Bug 343480
Using freed memory in overwrite confirm_overwrite_callback function
Last modified: 2006-05-31 07:14:36 UTC
The function confirm_overwrite_callback called when a user try to overwrite an existing file re-use the uri, in the popup presented when it correspond to a read-only uri, after having freed it. This could lead to random crash of the application (in the worst-case), and generally lead to a completely gibberish dialog. The attached patch correct the problem by only freeing the uri after presenting the dialog.
Created attachment 66514 [details] [review] Only free the uri after presenting it to the user We only free the uri after having called the replace_read_only_file function. Care is taken in order not to leak the uri.
Nice catch! Thank you. 2006-05-31 Paolo Borelli <pborelli@katamail.com> * gedit/gedit-commands-file.c (confirm_overwrite_callback): fix use after free. patch by Sylvain Defresne (bug #343480)