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:
@@ -896,7 +896,7 @@ namespace rpcn
|
|||||||
return error_and_disconnect("Failed to send all the bytes");
|
return error_and_disconnect("Failed to send all the bytes");
|
||||||
}
|
}
|
||||||
|
|
||||||
res = 0;
|
continue;
|
||||||
}
|
}
|
||||||
n_sent += res;
|
n_sent += res;
|
||||||
}
|
}
|
||||||
@@ -1055,6 +1055,8 @@ namespace rpcn
|
|||||||
found = found->ai_next;
|
found = found->ai_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
freeaddrinfo(addr_info);
|
||||||
|
|
||||||
if (!found_ipv4)
|
if (!found_ipv4)
|
||||||
{
|
{
|
||||||
rpcn_log.error("connect: Failed to find IPv4 for %s", host);
|
rpcn_log.error("connect: Failed to find IPv4 for %s", host);
|
||||||
@@ -1156,7 +1158,7 @@ namespace rpcn
|
|||||||
if (!connected || terminate)
|
if (!connected || terminate)
|
||||||
{
|
{
|
||||||
state = rpcn_state::failure_other;
|
state = rpcn_state::failure_other;
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (received_version != RPCN_PROTOCOL_VERSION)
|
if (received_version != RPCN_PROTOCOL_VERSION)
|
||||||
|
|||||||
@@ -79,6 +79,14 @@ public:
|
|||||||
res.push_back(vec[i]);
|
res.push_back(vec[i]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure we hit terminating 0
|
||||||
|
if (i >= vec.size())
|
||||||
|
{
|
||||||
|
error = true;
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if (!empty && res.empty())
|
if (!empty && res.empty())
|
||||||
|
|||||||
Reference in New Issue
Block a user