RE: [PATCH] [bpf] xdp_monitor_user: Fix null pointer dereference

2020-06-16 Thread John Fastabend
Gaurav Singh wrote: > Memset() on the pointer right after malloc() can cause > a null pointer dereference if it failed to allocate memory. > Fix this by replacing malloc/memset with a single calloc(). > > Signed-off-by: Gaurav Singh > --- > samples/bpf/xdp_monitor_user.c | 8 ++-- > 1 file c

[PATCH] [bpf] xdp_monitor_user: Fix null pointer dereference

2020-06-14 Thread Gaurav Singh
Memset() on the pointer right after malloc() can cause a null pointer dereference if it failed to allocate memory. Fix this by replacing malloc/memset with a single calloc(). Signed-off-by: Gaurav Singh --- samples/bpf/xdp_monitor_user.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions