From 1ffff099c164244b25429a0b726639c167d179f1 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 18 Oct 2010 03:18:35 -0400 Subject: [PATCH] Avoid checking the lengh of a null string. --- src/mod/event_handlers/mod_erlang_event/ei_helpers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c index 9935aff075..aca2497052 100644 --- a/src/mod/event_handlers/mod_erlang_event/ei_helpers.c +++ b/src/mod/event_handlers/mod_erlang_event/ei_helpers.c @@ -377,10 +377,11 @@ switch_status_t initialise_ei(struct ei_cnode_s *ec) // init the resolver res_init(); } - if (!zstr_buf(_res.dnsrch[0])) { + if (_res.dnsrch[0] && !zstr_buf(_res.dnsrch[0])) { strncat(thishostname, ".", 1); strncat(thishostname, _res.dnsrch[0], EI_MAXHOSTNAMELEN - strlen(thishostname)); } + } snprintf(thisnodename, MAXNODELEN + 1, "%s@%s", prefs.nodename, thishostname); }