apps/s_socket.c:477: error: UNINITIALIZED_VALUE
  The value read from in[_] was never initialized.
Showing all 1 steps of the trace


apps/s_socket.c:477:8: 
475.   		{
476.   		for (i=0; i<4; i++)
477. > 			if (in[i] > 255)
478.   				{
479.   				BIO_printf(bio_err,"invalid IP address\n");

int host_ip(char *str, unsigned char ip[4])
	{
	unsigned int in[4];
	int i;
	if (sscanf(str,"%d.%d.%d.%d",&(in[0]),&(in[1]),&(in[2]),&(in[3])) == 4)
		{
		for (i=0; i<4; i++)
			if (in[i] > 255)
				{
				BIO_printf(bio_err,"invalid IP address\n");
				goto err;
				}
		ip[0]=in[0];
		ip[1]=in[1];
		ip[2]=in[2];
		ip[3]=in[3];
		}
	else
		{
		struct hostent *he;
		if (!sock_init()) return(0);
		he=GetHostByName(str);
		if (he == NULL)
			{
			BIO_printf(bio_err,"gethostbyname failure\n");
			goto err;
			}
		if ((short)he->h_addrtype != AF_INET)
			{
			BIO_printf(bio_err,"gethostbyname addr is not AF_INET\n");
			return(0);
			}
		ip[0]=he->h_addr_list[0][0];
		ip[1]=he->h_addr_list[0][1];
		ip[2]=he->h_addr_list[0][2];
		ip[3]=he->h_addr_list[0][3];
		}
	return(1);
err:
	return(0);
	}
['int host_ip(char *str, unsigned char ip[4])\n\t{\n\tunsigned int in[4];\n\tint i;\n\tif (sscanf(str,"%d.%d.%d.%d",&(in[0]),&(in[1]),&(in[2]),&(in[3])) == 4)\n\t\t{\n\t\tfor (i=0; i<4; i++)\n\t\t\tif (in[i] > 255)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"invalid IP address\\n");\n\t\t\t\tgoto err;\n\t\t\t\t}\n\t\tip[0]=in[0];\n\t\tip[1]=in[1];\n\t\tip[2]=in[2];\n\t\tip[3]=in[3];\n\t\t}\n\telse\n\t\t{\n\t\tstruct hostent *he;\n\t\tif (!sock_init()) return(0);\n\t\the=GetHostByName(str);\n\t\tif (he == NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"gethostbyname failure\\n");\n\t\t\tgoto err;\n\t\t\t}\n\t\tif ((short)he->h_addrtype != AF_INET)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"gethostbyname addr is not AF_INET\\n");\n\t\t\treturn(0);\n\t\t\t}\n\t\tip[0]=he->h_addr_list[0][0];\n\t\tip[1]=he->h_addr_list[0][1];\n\t\tip[2]=he->h_addr_list[0][2];\n\t\tip[3]=he->h_addr_list[0][3];\n\t\t}\n\treturn(1);\nerr:\n\treturn(0);\n\t}']