Skip to content

potential null pointer deref? #19991

Description

@deian

We noticed these two sites as potential null pointer deferences.

const uint8_t* category_group_enabled =
GetCategoryGroupEnabled(category_group);
if (*category_group_enabled == 0) return;

const uint8_t* category_group_enabled =
GetCategoryGroupEnabled(category_group);
args.GetReturnValue().Set(*category_group_enabled > 0);

It seems like category_group_enabled can be null based on the defensive check:

static const uint8_t* GetCategoryGroupEnabled(const char* category_group) {
if (category_group == nullptr) return nullptr;
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group);
}

But I suspect because of the usage GetCategoryGroupEnabled is not called with null pointer. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    trace_eventsIssues and PRs related to trace events from V8, Node.js core, and user code.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions