From 6c2baed108de7cbeea94b6f526cfaa99d96de8c6 Mon Sep 17 00:00:00 2001 From: Daniel Swarbrick Date: Fri, 16 Nov 2012 23:36:29 +0100 Subject: [PATCH] Fix segfault in mod_cdr_mongo when "number" is null. Thanks Dave May for bug report and patch. Fixes FS-4843. --- src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c index d4c4d7cf9a..8a2b30d5e9 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/mod_cdr_mongodb.c @@ -204,8 +204,8 @@ static switch_status_t my_on_reporting(switch_core_session_t *session) bson_append_start_object(&cdr, "extension"); - bson_append_string(&cdr, "name", caller_profile->caller_extension->extension_name); - bson_append_string(&cdr, "number", caller_profile->caller_extension->extension_number); + bson_append_string(&cdr, "name", switch_str_nil(caller_profile->caller_extension->extension_name)); + bson_append_string(&cdr, "number", switch_str_nil(caller_profile->caller_extension->extension_number)); if (caller_profile->caller_extension->current_application) { bson_append_string(&cdr, "current_app", caller_profile->caller_extension->current_application->application_name);