lkml.org 
[lkml]   [2020]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] xdp_rxq_info_user: Fix null pointer dereference. Replace malloc/memset with calloc.
On Fri, 12 Jun 2020 14:53:27 -0400
Gaurav Singh <gaurav1086@gmail.com> wrote:

> Memset on the pointer right after malloc can cause a
> null pointer deference if it failed to allocate memory.
> A simple fix is to replace malloc/memset with a calloc()
>
> Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info")
> Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>

--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer

\
 
 \ /
  Last update: 2020-06-12 22:21    [W:0.161 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site