...
| Wiki Markup |
|---|
The footnote in Section 6.5.3.4 of the C Standard \[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] explains this: |
When applied to a parameter declared to have array or function type, the
sizeofoperator yields the size of the adjusted (pointer) type . . . .
...
Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
ARR01-C | high | probable | low | P18 | L1 |
Automated Detection
...
Tool | Version | Checker | Description |
|---|---|---|---|
|
...
Splint Version 3.1.1 can detect violations of this recommendation.
...
|
|
| |||||||||
|
|
|
| ||||||||
|
|
|
|
...
Related Vulnerabilities
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Other Languages
Related Guidelines
This rule appears in the C++ Secure Coding Standard as : ARR01-CPP. Do not apply the sizeof operator to a pointer when taking the size of an array.
Bibliography
| Wiki Markup |
|---|
\[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 6.7.5.2, "Array declarators" \[[Drepper 062006|AA. Bibliography#Drepper 06]\] Section 2.1.1, "Respecting Memory Bounds" \[[MITRE 072007|AA. Bibliography#MITRE 07]\] [CWE ID 467|http://cwe.mitre.org/data/definitions/467.html], "Use of sizeof() on a Pointer Type" |
...