| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
|---|---|---|---|---|---|---|---|---|---|
| 0001416 | Spring engine | General | public | 2009-05-26 18:47 | 2009-05-26 19:50 | ||||
| Reporter | AdamW | ||||||||
| Assigned To | tvo | ||||||||
| Priority | normal | Severity | major | Reproducibility | always | ||||
| Status | resolved | Resolution | fixed | ||||||
| Product Version | 0.79.0.2 | ||||||||
| Target Version | Fixed in Version | ||||||||
| Summary | 0001416: [patch] "format not a string literal and no format arguments" in spring_0.79.0.2/rts/Rendering/glFont.cpp:559 | ||||||||
| Description | I 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. | ||||||||
| Tags | No tags attached. | ||||||||
| Checked infolog.txt for Errors | |||||||||
| Attached Files |
| ||||||||
Notes |
|
|
jasonobrien (reporter) 2009-05-26 19:00 |
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 (reporter) 2009-05-26 19:50 |
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 |


