According to C11the C Standard, Section 7.4 [ISO/IEC 9899:2011],
...
Note: XSI denotes an X/Open System Interfaces Extension to ISO/IEC 9945—POSIX®. The functions are not defined by the C standardStandard.
STR34-C. Cast characters to unsigned char before converting to larger integer sizes is a generalization of this rule.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Compass/ROSE | Could detect violations of this rule by seeing if the argument to a character-handling function (listed above) is not an | ||||||||
| charplan | Fully implemented. | |||||||
PRQA QA-C |
| special case of STR34 | Fully implemented. |
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...
STR37-CPP. Arguments to character handling functions must be representable as an unsigned char | |
ISO/IEC |
...
TR 17961 | (Draft) Passing arguments to character-handling functions that are not representable as unsigned char [chrsgnext] |
MITRE CWE |
...
...
Incorrect type conversion or cast |
...
...
...
-686, |
...
Function call with incorrect argument type |
...
Bibliography
[ISO/IEC 9899:2011] | Section 7.4, "Character Handling <ctype.h >" |
[Kettlewell 2002] | Section 1.1, "<ctype.h > and |
...
Characters Types" |
...