A bug story: data alignment in C on x86 (2016)
Can&#x27;t this also segfault by overreading across a page boundary?<p>It&#x27;s assuming &quot;size&quot; is &gt;= 20 and is a multiple of 4. That might be true for all valid headers, but at least in this snippet, there&#x27;s no comment or anything stating the precondition that callers ensure the headers are valid. That&#x27;s a(nother) bug.<p>If it&#x27;s not true, it will read too much data. This means producing the wrong result. It also could make the read happen to cross a page boundary into space that isn&#x27;t mapped into the process&#x27;s virtual address space.