Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated reference from C11->C23.

...

According to the C Standard, 6.2.4, paragraph 2 [ISO/IEC 9899:20112024],

The lifetime of an object is the portion of program execution during which storage is guaranteed to be reserved for it. An object exists, has a constant address, and retains its last-stored value throughout its lifetime. If an object is referred to outside of its lifetime, the behavior is undefined. The value of If a pointer becomes indeterminate when value is used in an evaluation after the object it the pointer points to (or just past) reaches the end of its lifetime, the behavior is undefined.

Do not attempt to access an object outside of its lifetime. Attempting to do so is undefined behavior and can lead to an exploitable vulnerability. (See also undefined behavior 9 in the C Standard, Annex J.)

...

[Coverity 2007]
[ISO/IEC 9899:20112024]6.2.4, "Storage Durations of Objects"

...