samples/net/virtual: Increase sprintk buffers to hold parameter types

This sample app uses a stack buffer to hold the interface name which is
generated at runtime using sprintk. The buffer is only sized for the
expected range of values, not the full possible range of the datatype
(int).

To mitigate this, increase the size of the buffer to hold the full range of
an int value.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2022-06-07 14:49:24 -07:00 committed by Carles Cufí
commit be606f0932

View file

@ -44,7 +44,7 @@ struct virtual_test_context {
static void virtual_test_iface_init(struct net_if *iface)
{
struct virtual_test_context *ctx = net_if_get_device(iface)->data;
char name[16];
char name[sizeof("VirtualTest-+##########")];
static int count;
if (ctx->init_done) {