A brief but pointed analysis of memory safety's hardest unsolved problem: type confusion via tagged unions. When a union is initialized as one type, a pointer taken to its internals, then overwritten with a different type, the pointer becomes dangerously mistyped. This issue breaks even Ada's safety guarantees. The post also argues that buffer overflows — the most exploitable memory error in practice — are trivially fixable with bounds checks, and laments that the industry missed Walter Bright's early insight about array syntax in C that could have prevented many vulnerabilities.
10.3K Impressions1 Comment