View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015738CMakeCMakepublic2015-09-12 12:372016-02-01 09:10
ReporterThomas Klausner 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Platformx86_64OSNetBSDOS Version7.99.22
Product VersionCMake 3.3 
Target VersionCMake 3.4Fixed in VersionCMake 3.4 
Summary0015738: printw() should use format string
DescriptionMultiple files (in Source/CursesDialog/*.cxx) use the printw() function without a format string, i.e.
printw(some_variable);
This is unsafe; if some_variable contains "%s" or similar, you have problems.

Please use the
printw("%s", some_variable);
idiom instead.
Steps To ReproduceCode inspection.
Additional InformationThe attached patch fixes this issue.
TagsNo tags attached.
Attached Filesdiff file icon printw.diff [^] (2,900 bytes) 2015-09-12 12:37 [Show Content]

 Relationships

  Notes
(0039413)
Brad King (manager)
2015-09-14 09:39

For reference, this patch was also submitted to the mailing list:

 Portability patches / bug fixes
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14349 [^]
(0039414)
Brad King (manager)
2015-09-14 09:52

Patch (from list) applied:

 ccmake: Pass format string to 'printw'
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=acd9b4d3 [^]
(0039428)
Brad King (manager)
2015-09-16 08:44

Patch revised to avoid passing ""-literals to "char*":

 ccmake: Pass format string to 'printw'
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c442e5a [^]
(0040406)
Robert Maynard (manager)
2016-02-01 09:10

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-09-12 12:37 Thomas Klausner New Issue
2015-09-12 12:37 Thomas Klausner File Added: printw.diff
2015-09-14 09:39 Brad King Note Added: 0039413
2015-09-14 09:52 Brad King Note Added: 0039414
2015-09-14 09:52 Brad King Assigned To => Brad King
2015-09-14 09:52 Brad King Status new => resolved
2015-09-14 09:52 Brad King Resolution open => fixed
2015-09-14 09:52 Brad King Fixed in Version => CMake 3.4
2015-09-14 09:52 Brad King Target Version => CMake 3.4
2015-09-16 08:44 Brad King Note Added: 0039428
2016-02-01 09:10 Robert Maynard Note Added: 0040406
2016-02-01 09:10 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team