提交 1ffff099 authored 作者: Andrew Thompson's avatar Andrew Thompson

Avoid checking the lengh of a null string.

上级 dc40a778
......@@ -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);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论