Skip to content
Commit d59dd69d authored by Daniel T. Lee's avatar Daniel T. Lee Committed by Daniel Borkmann
Browse files

samples: bpf: fix: seg fault with NULL pointer arg



When NULL pointer accidentally passed to write_kprobe_events,
due to strlen(NULL), segmentation fault happens.
Changed code returns -1 to deal with this situation.

Bug issued with Smatch, static analysis.

Signed-off-by: default avatarDaniel T. Lee <danieltimlee@gmail.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 90b1023f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment