aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/UserDialog.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2012-04-25 15:43:56 +0000
committerPierre Ossman <ossman@cendio.se>2012-04-25 15:43:56 +0000
commitf52740e7eaead1170e20f25c7da79a98da97d6ff (patch)
treefd1cac9b31ea1e1498a1aee33606c18e09d16ee5 /vncviewer/UserDialog.cxx
parent33bead4a29a67d1d5ba0445647c330fd0bfae5eb (diff)
downloadtigervnc-f52740e7eaead1170e20f25c7da79a98da97d6ff.tar.gz
tigervnc-f52740e7eaead1170e20f25c7da79a98da97d6ff.zip
Make sure we're paranoid about accidentally feeding a format string.
Basic patch by Joachim Falk. Slightly improved before commit. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4900 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer/UserDialog.cxx')
-rw-r--r--vncviewer/UserDialog.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/vncviewer/UserDialog.cxx b/vncviewer/UserDialog.cxx
index f36d8437..b57588de 100644
--- a/vncviewer/UserDialog.cxx
+++ b/vncviewer/UserDialog.cxx
@@ -150,22 +150,20 @@ bool UserDialog::showMsgBox(int flags, const char* title, const char* text)
// FLTK doesn't give us a flexible choice of the icon, so we ignore those
// bits for now.
- // FIXME: Filter out % from input text
-
fl_message_title(title);
switch (flags & 0xf) {
case M_OKCANCEL:
- return fl_choice(buffer, NULL, fl_ok, fl_cancel) == 1;
+ return fl_choice("%s", NULL, fl_ok, fl_cancel, buffer) == 1;
case M_YESNO:
- return fl_choice(buffer, NULL, fl_yes, fl_no) == 1;
+ return fl_choice("%s", NULL, fl_yes, fl_no, buffer) == 1;
case M_OK:
default:
if (((flags & 0xf0) == M_ICONERROR) ||
((flags & 0xf0) == M_ICONWARNING))
- fl_alert(buffer);
+ fl_alert("%s", buffer);
else
- fl_message(buffer);
+ fl_message("%s", buffer);
return true;
}