[calls] contacts-provider: Guard against lookup with NULL id



commit 006673a9e1a18d5a4ddbf4ad2bd04b935396ac2a
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Tue Feb 15 07:55:33 2022 +0100

    contacts-provider: Guard against lookup with NULL id
    
    If the id is NULL g_str_hash(NULL) will be called which tries dereferencing the
    pointer.
    
    Fixes #408

 src/calls-contacts-provider.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/calls-contacts-provider.c b/src/calls-contacts-provider.c
index 0d5f95a3..41faeb2c 100644
--- a/src/calls-contacts-provider.c
+++ b/src/calls-contacts-provider.c
@@ -441,6 +441,7 @@ calls_contacts_provider_lookup_id (CallsContactsProvider *self,
   g_autoptr (CallsBestMatch) best_match = NULL;
 
   g_return_val_if_fail (CALLS_IS_CONTACTS_PROVIDER (self), NULL);
+  g_return_val_if_fail (id, NULL);
 
   best_match = g_hash_table_lookup (self->best_matches, id);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]