bugGKSu - Bugs: bug #19563, Format string bug in gksu.c

 
 

bug #19563: Format string bug in gksu.c

Submitter:  None
Submitted:  Mon 09 Apr 2007 10:43:21 PM UTC
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

Mon 09 Apr 2007 10:43:21 PM UTC, original submission:  

There is a format string bug in the function gk_dialog, in gksu.c :

149  diag_win = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL,
150 type, GTK_BUTTONS_CLOSE,
151 msg);

Indeed, the 5th parameter of the call to gtk_message_dialog_new_with_markup is not sanitizied, so a buggy msg can crash gksu.
This bug can be easilly reproduced :
% gksu '%s'
[...] give 3 wrong passwords [...]
zsh: segmentation fault (core dumped)

Here is a trivial patch :
--- gksu.c      2006-09-15 04:45:04.000000000 +0200
+++ gksu.c-patched      2007-04-10 00:40:44.000000000 +0200
@@ -148,7 +148,7 @@

   diag_win = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL,
                                                 type, GTK_BUTTONS_CLOSE,
-                                                msg);
+                                                '%s', msg);

   gtk_signal_connect_object (GTK_OBJECT(diag_win), "delete_event",
                             GTK_SIGNAL_FUNC(gtk_main_quit),

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

 

 

 

No changes have been made to this item

Back to the top


Powered by Savane 3.9