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

Compare with Current View Page History

« Previous Version 22 Next »

Type conversions occur explicitly as the result of a cast or implicitly as required by an operation. While conversions are generally required for the correct execution of a program, they can also lead to lost or misinterpreted data.

The C99 standard rules define how C compilers handle conversions. These rules include integer promotions, integer conversion rank, and the usual arithmetic conversions.

Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.
Unable to render {include} The included page could not be found.

Consequences

Misunderstanding integer conversion rules can lead to integer errors, which in turn can lead to exploitable vulnerabilites.

References

[[Seacord 05]] Chapter 5, "Integers"

[[ISO/IEC 9899-1999]] Section 6.3, "Conversions"

[[Dowd 06]] Chapter 6, "C Language Issues" (Type Conversions 223-270)

  • No labels