RE: [PATCH net-next v3] ice: Replace one-element arrays with flexible-arrays

2020-05-28 Thread Kirsher, Jeffrey T
. Silva ; > Kees Cook > Subject: [PATCH net-next v3] ice: Replace one-element arrays with flexible- > arrays > > The current codebase makes use of one-element arrays in the following > form: > > struct something { > int length; > u8 data[1]; > }; > >

[PATCH net-next v3] ice: Replace one-element arrays with flexible-arrays

2020-05-27 Thread Gustavo A. R. Silva
The current codebase makes use of one-element arrays in the following form: struct something { int length; u8 data[1]; }; struct something *instance; instance = kmalloc(sizeof(*instance) + size, GFP_KERNEL); instance->length = size; memcpy(instance->data, source, size); but the preferre