Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
[Issue#25] Return NULL if callbacks == NULL for get_cb
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFrench committed Jul 31, 2017
1 parent 8ac2eaf commit cfcdba4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions evhtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4214,6 +4214,12 @@ evhtp_get_cb(evhtp_t * htp, const char * path)
{
evhtp_callback_t * callback;

evhtp_assert(htp != NULL);

if (evhtp_unlikely(htp->callbacks == NULL)) {
return NULL;
}

TAILQ_FOREACH(callback, htp->callbacks, next)
{
if (strcmp(callback->val.path, path) == 0)
Expand Down

0 comments on commit cfcdba4

Please sign in to comment.