Skip to content

Commit e74a88d

Browse files
committed
Cast u_short to int & fix nullptr
1 parent 27fa95c commit e74a88d

File tree

1 file changed

+2
-2
lines changed
  • c/meterpreter/source/extensions/stdapi/server/net

1 file changed

+2
-2
lines changed

c/meterpreter/source/extensions/stdapi/server/net/resolve.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ DWORD resolve_host(const LPCSTR hostname, u_short ai_family, struct addrinfo **o
3737
struct addrinfo hints = { 0 };
3838
hints.ai_socktype = SOCK_DGRAM;
3939
hints.ai_protocol = IPPROTO_UDP;
40-
hints.ai_family = ai_family;
40+
hints.ai_family = (int)ai_family;
4141

4242
dprintf("Attempting to resolve '%s'", hostname);
4343

@@ -103,7 +103,7 @@ DWORD request_resolve_host(Remote *remote, Packet *packet)
103103
u_short ai_family = met_api->packet.get_tlv_value_uint(packet, TLV_TYPE_ADDR_TYPE);
104104
DWORD iResult = ERROR_SUCCESS;
105105

106-
struct addrinfo* result = NULL;
106+
struct addrinfo* result;
107107
iResult = resolve_host(hostname, ai_family, &result);
108108
if (iResult != ERROR_SUCCESS || result == NULL)
109109
{

0 commit comments

Comments
 (0)