rpcn_client: Misc fixes

Fix missing freeaddrinfo
Fix wrong return value in a rpcn_client::connect() path
Fix missing 0 presence validation in vec_stream::get_string()
This commit is contained in:
RipleyTom 2026-02-19 22:18:34 +01:00 committed by Elad
parent 2064bd87e3
commit 53dcf2ba00
2 changed files with 12 additions and 2 deletions

View file

@ -896,7 +896,7 @@ namespace rpcn
return error_and_disconnect("Failed to send all the bytes");
}
res = 0;
continue;
}
n_sent += res;
}
@ -1055,6 +1055,8 @@ namespace rpcn
found = found->ai_next;
}
freeaddrinfo(addr_info);
if (!found_ipv4)
{
rpcn_log.error("connect: Failed to find IPv4 for %s", host);
@ -1156,7 +1158,7 @@ namespace rpcn
if (!connected || terminate)
{
state = rpcn_state::failure_other;
return true;
return false;
}
if (received_version != RPCN_PROTOCOL_VERSION)

View file

@ -79,6 +79,14 @@ public:
res.push_back(vec[i]);
i++;
}
// Make sure we hit terminating 0
if (i >= vec.size())
{
error = true;
return {};
}
i++;
if (!empty && res.empty())