Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/api/HttpHookState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ HttpHookState::getNext()
void
HttpHookState::Scope::init(HttpAPIHooks const *feature_hooks, TSHttpHookID id)
{
// operator[] yields nullptr for an out of range id, and a release build can reach that: the only thing rejecting a
// bad hook id upstream is an assert that compiles out. Leave the scope empty rather than dereferencing null.
_hooks = (*feature_hooks)[id];

_p = nullptr;
_c = _hooks->head();
_c = _hooks ? _hooks->head() : nullptr;
}

APIHook const *
Expand Down