Skip to content

Commit

Permalink
utils: Null dereference amend
Browse files Browse the repository at this point in the history
issue namhyung#1553 related Null dereference amend works.

Signed-off-by: Paran Lee <p4ranlee@gmail.com>
  • Loading branch information
paranlee committed Sep 16, 2022
1 parent 53550c7 commit fa1836f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmds/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ static void dump_raw_kernel_event(struct uftrace_dump_ops *ops,
int size = 0;

event = pevent_find_event(kernel->pevent, frs->addr);
if (!event)
return;

event_data = read_kernel_event(kernel, cpu, &size);

pr_time(frs->time);
Expand Down
3 changes: 3 additions & 0 deletions utils/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ bool check_kernel_pid_filter(void)
bool ret = true;
char *filename = get_tracing_file("options/function-fork");

if (filename == NULL)
return false;

if (!access(filename, F_OK))
ret = false;

Expand Down
3 changes: 3 additions & 0 deletions utils/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ enum script_type_t get_script_type(const char *str)
{
char *ext = strrchr(str, '.');

if (ext == NULL)
return SCRIPT_UNKNOWN;

/*
* The given script will be detected by the file suffix.
* As of now, it only handles ".py" suffix for python.
Expand Down

0 comments on commit fa1836f

Please sign in to comment.