mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-10-12 02:09:17 +00:00
fix: don't put 0 sized data packets in received_data
This commit is contained in:
@@ -420,7 +420,7 @@ bool lv2_socket_p2ps::handle_connected(p2ps_encapsulated_tcp* tcp_header, u8* da
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!received_data.count(tcp_header->seq))
|
||||
if (!received_data.count(tcp_header->seq) && tcp_header->length != 0u)
|
||||
{
|
||||
// New data
|
||||
received_data.emplace(tcp_header->seq, std::vector<u8>(data, data + tcp_header->length));
|
||||
|
||||
@@ -1253,7 +1253,7 @@ namespace rpcn
|
||||
auto get_usernames = [](vec_stream& stream, std::set<std::string>& usernames)
|
||||
{
|
||||
u32 num_usernames = stream.get<u32>();
|
||||
for (u32 i = 0; i < num_usernames; i++)
|
||||
for (u32 i = 0; i < num_usernames && !stream.is_error(); i++)
|
||||
{
|
||||
std::string username = stream.get_string(false);
|
||||
usernames.insert(std::move(username));
|
||||
|
||||
Reference in New Issue
Block a user