This chapter follows data from bytes in memory, through the rules of the C language, down to the instructions that a processor executes, because most security failures in low-level code happen at one of these steps. It begins with the lifetime and ownership of objects and with the classic memory errors: buffer overflows §4.4, out-of-bounds reads §4.5, use after free §4.6, double free §4.7, leaks, heap fragmentation §4.9 and stack overflow §4.10. It then explains how C defines, and in places declines to define, what a program does: undefined, implementation-defined and unspecified behavior §4.14; signed and unsigned arithmetic and the checks that keep it in range; integer promotion §4.18, conversion, truncation and extension §4.19; shifts, endianness §4.21 and alignment §4.22; and the strict aliasing rule §4.23, pointer provenance §4.24, pointer arithmetic §4.25 and null pointers §4.26.
The middle of the chapter treats data formats: structure padding §4.27, serialization §4.28 and deserialization §4.29, length-prefixed frames, type-length-value §4.31 records, checksums §4.32 and cyclic redundancy checks, and the constant-time comparison §4.33 of secret values. Then come the places where software meets hardware: the volatile qualifier §4.34, memory-mapped device registers, direct memory access §4.36 and memory barriers §4.37. The last part descends to machine code on Arm Cortex-M processors: the instruction set architecture §4.38 and the microarchitecture §4.39 beneath it, the Thumb instruction encodings §2.7, condition flags §4.42 and conditional execution, encoded constants, the link register §4.45, and the questions that an analysis of machine code must answer about live registers, forwarded memory values, read-only memory and the boundary of what it has proved. Two reference entries close the chapter: binary floating-point numbers §4.49 and bit operations §4.50.