[cfe-dev] strncpy checker

Leonard Maiorani Lenny at Colorado.EDU
Tue Dec 14 11:37:18 PST 2010


Attached is my first foray into Clang Static Analyzer contributions. Please review for style and correctness. Take punches at it if you will, I am tough enough. Unit tests are included.

strncpy() was not being checked at all, so this should solve that problem by ensuring that the 'n' parameter to strncpy() is not larger than the size of the buffer passed in because that would indicate a logic error and potential bus error.

-Lenny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strncpy-checker.diff
Type: application/octet-stream
Size: 8098 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101214/9065c452/attachment.obj>
-------------- next part --------------



       __o
     _`\<,_
    (*)/ (*)
~~~~~~~~~~~~~~~~~~~~



More information about the cfe-dev mailing list