From b56218ee25846aee2726480437c4ed097a55d55a Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 14 Mar 2018 15:01:07 +0000 Subject: [PATCH] enhanced the error handling of address conversion failure --- lib/hcl-s.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hcl-s.c b/lib/hcl-s.c index 4fb8f58..8b1dd20 100644 --- a/lib/hcl-s.c +++ b/lib/hcl-s.c @@ -1794,7 +1794,11 @@ int hcl_server_start (hcl_server_t* server, const hcl_bch_t* addrs) * 192.168.1.1:20,[::1]:20,127.0.0.1:345 */ sck_fam = bchars_to_sockaddr(server, addrs, hcl_countbcstr(addrs), &srv_addr, &srv_len); - if (sck_fam <= -1) return -1; + if (sck_fam <= -1) + { + hcl_server_seterrbfmt (server, HCL_EINVAL, "unable to convert address - %hs", addrs); + return -1; + } srv_fd = socket(sck_fam, SOCK_STREAM, 0); if (srv_fd == -1)