[LLVMbugs] [Bug 11141] New: Provide a fixit hint for non-const format string with no other parameters.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Oct 15 08:25:04 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11141

           Summary: Provide a fixit hint for non-const format string with
                    no other parameters.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: benny.kra at gmail.com
                CC: llvmbugs at cs.uiuc.edu


A relatively common pattern is


char *foo;
…
printf(foo);


clang warns about this because it's a potential security problem if foo is
user-controlled.
That warning should provide a fixit to add "%s".

printf("%s", foo);

The tricky part is to get this right for all flavors of format string functions
(e.g. NSLog(@"%@", nsstring);)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list