From 26336805d227d1763d873bfce6eb12772cf8922f Mon Sep 17 00:00:00 2001 From: Will Xyen Date: Thu, 8 Jul 2021 22:25:45 -0700 Subject: [PATCH] iidxhook: fix eamuse hook not using a sane port as the default when none are specified (#64) --- src/main/iidxhook-util/eamuse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/iidxhook-util/eamuse.c b/src/main/iidxhook-util/eamuse.c index ff1891a..15d77da 100644 --- a/src/main/iidxhook-util/eamuse.c +++ b/src/main/iidxhook-util/eamuse.c @@ -168,6 +168,14 @@ void eamuse_set_addr(const struct net_addr *addr) tmp_str2 = net_addr_to_str(&eamuse_server_addr_resolved); + // when resolving URLs with net_str_parse + // it will default to NET_INVALID_PORT if no port is specified + // assume default 80 here as a good sanity check + if (eamuse_server_addr_resolved.ipv4.port == NET_INVALID_PORT) { + log_info("No port was specified, using port 80 as fallback"); + eamuse_server_addr_resolved.ipv4.port = 80; + } + log_info("Target eamuse server %s resolved to %s", tmp_str, tmp_str2); free(tmp_str);