Skip to content

Commit 8a2aedf

Browse files
committed
Makes error handling consistent with other Meterpreter implementations
1 parent a4bd5ee commit 8a2aedf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mettle/src/stdapi/net/resolve.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ void resolve_host_async(struct eio_req *req)
3737
goto done;
3838
}
3939

40+
ret_val = TLV_RESULT_FAILURE;
41+
4042
struct addrinfo hints = {
4143
.ai_family = addr_type,
4244
};
@@ -51,6 +53,7 @@ void resolve_host_async(struct eio_req *req)
5153

5254
int result = getaddrinfo(hostname, NULL, &hints, &resolved_host);
5355
if (result == 0) {
56+
ret_val = TLV_RESULT_SUCCESS;
5457
struct tlv_packet *resolve_host_entry = tlv_packet_new(TLV_TYPE_RESOLVE_HOST_ENTRY, 0);
5558
struct addrinfo* i;
5659
for(i=resolved_host; i!=NULL; i=i->ai_next)

0 commit comments

Comments
 (0)