From 202967b94a0139fad4924c4ba365b45b3df12d34 Mon Sep 17 00:00:00 2001 From: Bruno Cabral Date: Fri, 5 Sep 2014 03:10:59 +0000 Subject: Do not crash if key is NULL. --- src/fs/gnunet-service-fs_cadet_server.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/fs') diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c index 77add757d..5e4715781 100644 --- a/src/fs/gnunet-service-fs_cadet_server.c +++ b/src/fs/gnunet-service-fs_cadet_server.c @@ -345,9 +345,17 @@ handle_datastore_reply (void *cls, hard error as we might have had the answer in the past and the user might have unindexed it. Hence we log at level "INFO" for now. */ - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Have no answer for query `%s'\n", - GNUNET_h2s (key)); + if(NULL == key) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Have no answer and the query was NULL\n"); + } + else + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Have no answer for query `%s'\n", + GNUNET_h2s (key)); + } GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# queries received via cadet not answered"), 1, GNUNET_NO); -- cgit v1.2.3