Patch #3430 has been updated. 

Project: lincity-ng
Category: None
Status: Out of date
Submitted by: apoleon
Assigned to : none
Summary: fix format not a string literal error

Follow-Ups:

Date: 2013-Mar-04 22:36
By: apoleon

Comment:
I have compiled LinCityNG with Debian Unstable and the GNU C++ compiler, 
version 4.7.2.

Debian as other Linux distributions has started to make us of certain hardening 
build flags. http://wiki.debian.org/Hardening

The game was compiled with -Werror=format-security, and these kind of warnings 
are treated as errors thus LinCityNG fails to build from source. Quoting the 
gcc man page.

http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

If -Wformat is specified, also warn about uses of format functions that 
represent possible security problems. At present, this warns about calls to 
printf and scanf functions where the format string is not a string literal and 
there are no format arguments, as in printf (foo);. This may be a security hole 
if the format string came from untrusted input and contains %n. 

So the compiler warns about "possible" security problems and treats them as 
errors. I need to apply this patch in order to build the game successfully.


-------------------------------------------------------

Date: 2013-Mar-09 19:02
By: wolfgangb

Comment:
fixed in r1566.
http://svn.berlios.de/viewvc/lincity-ng?view=revision&revision=1566
-------------------------------------------------------

Date: 2013-Mar-04 22:13
By: wolfgangb

Comment:
Which compiler gives that warning? If I understand this correctly it complains 
about the format string being generated at runtime from translations. That way
the compiler can't check if the string contains a place-holder. So why is it a 
fix to 
add one argument? What if someone translates the message to contain 
several place-holders? And why does it accept all the other snprintf with 
translatable format strings in that file?

-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://developer.berlios.de/patch/?func=detailpatch&patch_id=3430&group_id=2929
_______________________________________________
Lincity-ng-devel mailing list
Lincity-ng-devel@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/lincity-ng-devel

Reply via email to