You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 140 Next »

Recommendations

EXP00-C. Use parentheses for precedence of operation

EXP01-C. Do not take the size of a pointer to determine the size of the pointed-to type

EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators

EXP03-C. Do not assume the size of a structure is the sum of the sizes of its members

EXP04-C. Do not perform byte-by-byte comparisons involving a structure

EXP05-C. Do not cast away a const qualification

EXP06-C. Operands to the sizeof operator should not contain side effects

EXP07-C. Do not diminish the benefits of constants by assuming their values in expressions

EXP08-C. Ensure pointer arithmetic is used correctly

EXP09-C. Use sizeof to determine the size of a type or variable

EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place

EXP11-C. Do not apply operators expecting one type to data of an incompatible type

EXP12-C. Do not ignore values returned by functions

EXP13-C. Treat relational and equality operators as if they were nonassociative

EXP14-C. Beware of integer promotion when performing bitwise operations on chars or shorts

Rules

EXP30-C. Do not depend on order of evaluation between sequence points

EXP31-C. Avoid side effects in assertions

EXP32-C. Do not access a volatile object through a non-volatile reference

EXP33-C. Do not reference uninitialized memory

EXP34-C. Do not dereference null pointers

EXP35-C. Do not access or modify an array in the result of a function call after a subsequent sequence point

EXP36-C. Do not convert pointers into more strictly aligned pointer types

EXP37-C. Call functions with the arguments intended by the API

EXP38-C. Do not call offsetof() on bit-field members or invalid types

EXP39-C. Do not access a variable through a pointer of an incompatible type 

Risk Assessment Summary

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

EXP00-C

low

probable

medium

P4

L3

EXP01-C

high

probable

medium

P12

L1

EXP02-C

low

unlikely

medium

P2

L3

EXP03-C

medium

unlikely

high

P2

L3

EXP04-C

medium

unlikely

high

P2

L3

EXP05-C

medium

probable

medium

P8

L2

EXP06-C

low

unlikely

low

P3

L3

EXP07-C

low

unlikely

medium

P2

L3

EXP08-C

high

probable

high

P6

L2

EXP09-C

high

unlikely

medium

P6

L2

EXP10-C

medium

probable

medium

P8

L2

EXP11-C

medium

probable

medium

P8

L2

EXP12-C

medium

unlikely

medium

P4

L3

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP30-C

medium

probable

medium

P8

L2

EXP31-C

low

unlikely

low

P3

L3

EXP32-C

low

likely

medium

P6

L2

EXP33-C

high

probable

medium

P12

L1

EXP34-C

high

likely

medium

P18

L1

EXP35-C

low

probable

medium

P4

L3

EXP36-C

low

probable

medium

P4

L3

EXP37-C

medium

probable

high

P4

L3

EXP38-C

low

unlikely

medium

P2

L3

EXP39-C

medium

unlikely

high

P6

L2

Related Rules and Recommendations


      CERT C Secure Coding Standard      

  • No labels