Skip to content

Commit

Permalink
lib: Add a null guard
Browse files Browse the repository at this point in the history
get_event_config() can cause a segfault if NULL is passed to it, since
GHashTable tries to hash the pointer as a string.

Reproducible just by switching to the “Confirm data to report” tab
manually.

Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
  • Loading branch information
ernestask authored and mkutlak committed Nov 29, 2018
1 parent 7803e4d commit 1db19d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/event_config.c
Expand Up @@ -310,6 +310,9 @@ void free_event_config_data(void)

event_config_t *get_event_config(const char *name)
{
if (name == NULL)
return NULL;

if (!g_event_config_list)
return NULL;
if (g_event_config_symlinks)
Expand Down

0 comments on commit 1db19d0

Please sign in to comment.