From c6bd3b166e30f60dc631e986ee38517668813398 Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Tue, 2 Apr 2019 12:32:38 -0700 Subject: [PATCH] Return default of false for _bpf_enabled() (#1355) If the scap handle doesn't exist, return false from _bpf_enabled() methods. --- userspace/libscap/scap.c | 2 ++ userspace/libsinsp/sinsp.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/userspace/libscap/scap.c b/userspace/libscap/scap.c index 3ee62b5cf0..e5d8131084 100644 --- a/userspace/libscap/scap.c +++ b/userspace/libscap/scap.c @@ -1973,6 +1973,8 @@ bool scap_get_bpf_enabled(scap_t *handle) { return handle->m_bpf; } + + return false; } int32_t scap_suppress_events_comm(scap_t *handle, const char *comm) diff --git a/userspace/libsinsp/sinsp.cpp b/userspace/libsinsp/sinsp.cpp index 8934b56572..bb32831e1c 100644 --- a/userspace/libsinsp/sinsp.cpp +++ b/userspace/libsinsp/sinsp.cpp @@ -2432,6 +2432,8 @@ bool sinsp::is_bpf_enabled() { return scap_get_bpf_enabled(m_h); } + + return false; } ///////////////////////////////////////////////////////////////////////////////