Skip to content

Commit

Permalink
Cast u_short to int & fix nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 committed Nov 16, 2023
1 parent 27fa95c commit e74a88d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c/meterpreter/source/extensions/stdapi/server/net/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DWORD resolve_host(const LPCSTR hostname, u_short ai_family, struct addrinfo **o
struct addrinfo hints = { 0 };
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
hints.ai_family = ai_family;
hints.ai_family = (int)ai_family;

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

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

struct addrinfo* result = NULL;
struct addrinfo* result;
iResult = resolve_host(hostname, ai_family, &result);
if (iResult != ERROR_SUCCESS || result == NULL)
{
Expand Down

0 comments on commit e74a88d

Please sign in to comment.