Commit e459edc9 authored by Kazuhito Hagio's avatar Kazuhito Hagio
Browse files

[PATCH] remove variable length array in get_machdep_info_x86_64()



Variable length arrays can be problematic. For example with C11 they got
downgraded to an optional feature and thus might not be supported in all
environments. Furthermore they don't allow error checks whether the
allocation succeeded. If it fails this causes undefined behavior. This is
especially problematic when its size is read from a dump as it might have
been corrupted, like it is done for info->page_size used in MFNS_PER_FRAME
and MAX_X86_64_FRAMES. Thus get rid of variable length arrays and allocate
them on the heap instead.

Signed-off-by: default avatarKazuhito Hagio <k-hagio-ab@nec.com>
parent d2ffef88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment