Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of [-Wformat-security] warning in nsFilePicker.cpp #26

Open
darealshinji opened this issue Nov 25, 2014 · 1 comment
Open

Get rid of [-Wformat-security] warning in nsFilePicker.cpp #26

darealshinji opened this issue Nov 25, 2014 · 1 comment

Comments

@darealshinji
Copy link
Contributor

Any idea how to fix the remaining [-Wformat-security] warning in xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp? I don't really know if putting a "%s", in front of NS_ConvertUTF16toUTF8 is the correct way to do this here.
https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-Wformat_-Wformat-security

/build/buildd/nightingale-deps-20140722/xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp: In function 'PRBool confirm_overwrite_file(GtkWidget*, nsILocalFile*)':
/build/buildd/nightingale-deps-20140722/xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp:410:71: warning: format not a string literal and no format arguments [-Wformat-security]
                                   NS_ConvertUTF16toUTF8(message).get());
                                                                       ^
@freaktechnik
Copy link
Member

Firt of all, you will surely get a valid UTF8 string from a NS_ConvertUTF16toUTF8 object. Further it doesn't seem as if the gtk_window_set_title method supports three arguments: https://developer.gnome.org/gtk2/stable/GtkWindow.html#gtk-window-set-title
P.S.: Direct link to the source where the warning origins from: https://github.com/nightingale-media-player/nightingale-deps/blob/xul-192-new/xulrunner-1.9.2/mozilla/widget/src/gtk2/nsFilePicker.cpp#L411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants