Skip to content

Commit 7cdb9cb

Browse files
r41k0uCopilot
andcommitted
Add null-safety check after deref_to_depth in helper_utils
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0482aa2 commit 7cdb9cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pythonbpf/helper/helper_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def get_or_create_ptr_from_arg(
111111
_, expected_depth = get_base_type_and_depth(expected_type)
112112
if val_depth > expected_depth:
113113
val = deref_to_depth(func, builder, val, val_depth - expected_depth)
114+
if val is None:
115+
raise ValueError("Failed to dereference pointer to expected depth")
114116

115117
ptr, temp_name = compilation_context.scratch_pool.get_next_temp(
116118
local_sym_tab, expected_type

0 commit comments

Comments
 (0)