Safer flexible arrays for the kernel
Safer flexible arrays for the kernel
Posted Sep 30, 2022 2:25 UTC (Fri) by mirabilos (subscriber, #84359)Parent article: Safer flexible arrays for the kernel
You *never* use sizeof on a struct with a flexible array member. You use offsetof of that member plus the size of the extra area to allocate.
        
 
           