View Issue Details

IDProjectCategoryView StatusLast Update
0001416Spring engineGeneralpublic2009-05-26 19:50
ReporterAdamW Assigned Totvo  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version0.79.0.2 
Summary0001416: [patch] "format not a string literal and no format arguments" in spring_0.79.0.2/rts/Rendering/glFont.cpp:559
DescriptionI am the maintainer of Mandriva's packages for spring. Mandriva buildsystem sets "format not a string literal and no format arguments" to be an error rather than a warning, as it always indicates a coding error that should be fixed, and is a problem that can frequently cause security issues. See Mandriva's write-up of the issue:

http://wiki.mandriva.com/en/Development/Packaging/Problems#format_not_a_string_literal_and_no_format_arguments

Trying to update the package to 0.79.0.2, I am hitting such an error in spring_0.79.0.2/rts/Rendering/glFont.cpp:559 :

/home/adamw/rpm/BUILD/spring_0.79.0.2/rts/Rendering/glFont.cpp: In static member function 'static CglFont* CglFont::LoadFont(const std::string&, int, int, float, int, int)':
/home/adamw/rpm/BUILD/spring_0.79.0.2/rts/Rendering/glFont.cpp:559: error: format not a string literal and no format arguments

unfortunately, I'm not a hacker and this code in question doesn't exactly fit the examples on the Mandriva page, so I cannot fix it myself and provide a patch. Thanks a lot for looking at this issue.
TagsNo tags attached.
Attached Files
glFont.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

jasonobrien

2009-05-26 19:00

reporter   ~0003487

This is a problem with our function overloading, we have two methods one that takes printf-style args and another that simply takes a string. The printf style one prevents promotion of c-stings to std::string, even if we pass no format arguments. As far as solutions go, renaming the function to PrintFormat would do. For now, submitted a patch which forces the correct function choice.

tvo

2009-05-26 19:50

reporter   ~0003490

committed, thanks.

Issue History

Date Modified Username Field Change
2009-05-26 18:47 AdamW New Issue
2009-05-26 19:00 jasonobrien Note Added: 0003487
2009-05-26 19:00 jasonobrien File Added: glFont.patch
2009-05-26 19:44 tvo Summary "format not a string literal and no format arguments" in spring_0.79.0.2/rts/Rendering/glFont.cpp:559 => [patch] "format not a string literal and no format arguments" in spring_0.79.0.2/rts/Rendering/glFont.cpp:559
2009-05-26 19:44 tvo Status new => assigned
2009-05-26 19:44 tvo Assigned To => tvo
2009-05-26 19:50 tvo Note Added: 0003490
2009-05-26 19:50 tvo Status assigned => resolved
2009-05-26 19:50 tvo Fixed in Version => master
2009-05-26 19:50 tvo Resolution open => fixed