← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/format_security into lp:widelands

 

SirVer has proposed merging lp:~widelands-dev/widelands/format_security into lp:widelands.

Commit message:
Add to the compile options and fix new errors -Werror=format-security.

The PPA build bot apparently uses this option, that is the reason why nightly PPA builds are currently failing. Enabling this by default is probably also a sane option anyways. 

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/format_security/+merge/292699
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/format_security into lp:widelands.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2016-03-09 07:15:44 +0000
+++ CMakeLists.txt	2016-04-23 08:37:45 +0000
@@ -166,11 +166,11 @@
 endif()
 
 # Turn some warnings into errors.
+wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=format-security")
 wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=return-type")
 wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=shadow")
 wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Werror=uninitialized")
 
-
 IF (WIN32)
   add_definitions(-DMINGW_HAS_SECURE_API)
   if (CMAKE_SIZEOF_VOID_P EQUAL 4)

=== modified file 'src/graphic/text/rt_render.cc'
--- src/graphic/text/rt_render.cc	2016-04-20 09:57:21 +0000
+++ src/graphic/text/rt_render.cc	2016-04-23 08:37:45 +0000
@@ -603,7 +603,7 @@
 			const std::string error_message =
 					(boost::format("Texture (%d, %d) too big! Maximum size is %d.")
 					 % width() % height() % g_gr->max_texture_size()).str();
-			log((error_message + "\n").c_str());
+			log("%s\n", error_message.c_str());
 			throw TextureTooBig(error_message);
 		}
 		Texture* rv = new Texture(width(), height());


Follow ups