From 358c7bf39fc742edb89af57527bd1aa8054f20fa Mon Sep 17 00:00:00 2001 From: dbrooks Date: Wed, 11 Nov 2009 19:46:19 +0000 Subject: Solaris doesn't like NULL going to ast_log Solaris will crash if NULL is passed to ast_log. This simple patch simply uses S_OR to get around this. (closes issue #15392) Reported by: yrashk git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@229498 f38db490-d61c-443f-a65b-d21fe96a405b --- main/pbx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/pbx.c b/main/pbx.c index 529899793..9f4c63fd7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -1893,22 +1893,23 @@ static int pbx_extension_helper(struct ast_channel *c, struct ast_context *con, } } else { /* not found anywhere, see what happened */ ast_unlock_contexts(); + /* Using S_OR here because Solaris doesn't like NULL being passed to ast_log */ switch (q.status) { case STATUS_NO_CONTEXT: if (!matching_action) - ast_log(LOG_NOTICE, "Cannot find extension context '%s'\n", context); + ast_log(LOG_NOTICE, "Cannot find extension context '%s'\n", S_OR(context, "")); break; case STATUS_NO_EXTENSION: if (!matching_action) - ast_log(LOG_NOTICE, "Cannot find extension '%s' in context '%s'\n", exten, context); + ast_log(LOG_NOTICE, "Cannot find extension '%s' in context '%s'\n", exten, S_OR(context, "")); break; case STATUS_NO_PRIORITY: if (!matching_action) - ast_log(LOG_NOTICE, "No such priority %d in extension '%s' in context '%s'\n", priority, exten, context); + ast_log(LOG_NOTICE, "No such priority %d in extension '%s' in context '%s'\n", priority, exten, S_OR(context, "")); break; case STATUS_NO_LABEL: if (context) - ast_log(LOG_NOTICE, "No such label '%s' in extension '%s' in context '%s'\n", label, exten, context); + ast_log(LOG_NOTICE, "No such label '%s' in extension '%s' in context '%s'\n", label, exten, S_OR(context, "")); break; default: if (option_debug) -- cgit v1.2.3