﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
548	A wrong server config in upstream get an error ip addr	leo liu		"in an upstream config like :
upstream test{
    server 1181;
    keepalive 256;
}

then nginx get an backend address 0.0.4.157

(gdb) n
1100            h = gethostbyname((char *) host);
(gdb) p host
$17 = (u_char *) 0x1021cd0 ""1181""
(gdb) n
1102            ngx_free(host);
(gdb) p h
$18 = (struct hostent *) 0x7ffff66c0f00
(gdb) p *h
$19 = {h_name = 0x1028a18 ""1181"", h_aliases = 0x1028a10, h_addrtype = 2, h_length = 4, h_addr_list = 0x1028a00}
(gdb) p h->h_addr_list[0]
$20 = 0x10289f0 """"
(gdb) x/10c (h->h_addr_list[0])
0x10289f0:      0 '\000'        0 '\000'        4 '\004'        -99 '\235'      0 '\000'        0 '\000'        0 '\000'        0 '\000'
...
(gdb) 
1129                sin->sin_addr.s_addr = *(in_addr_t *) (h->h_addr_list[i]);

Here nginx get the ip address 0.0.4.157.
Problem is gethostbyname return an empty string,not NULL。Maybe test  ""if (h == NULL || h->h_addr_list[0] == NULL)"" at line 926 is wrong！"	defect	closed	minor		nginx-core	1.4.x	wontfix			Linux 3.5.0-44-generic #67~precise1-Ubuntu SMP Wed Nov 13 16:16:57 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.4.4
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
TLS SNI support enabled
configure arguments: --with-debug"
