Browse Source

Fix profile packets in SDK client not including the null terminator for the strings

merge-requests/721/merge
Adam Honse 4 months ago
parent
commit
b6cc0bda21
  1. 6
      NetworkClient.cpp

6
NetworkClient.cpp

@ -868,7 +868,7 @@ void NetworkClient::SendRequest_LoadProfile(std::string profile_name)
reply_hdr.pkt_dev_idx = 0;
reply_hdr.pkt_id = NET_PACKET_ID_REQUEST_LOAD_PROFILE;
reply_hdr.pkt_size = profile_name.size();
reply_hdr.pkt_size = strlen(profile_name.c_str()) + 1;
send(client_sock, (char *)&reply_hdr, sizeof(NetPacketHeader), MSG_NOSIGNAL);
send(client_sock, (char *)profile_name.c_str(), reply_hdr.pkt_size, MSG_NOSIGNAL);
@ -885,7 +885,7 @@ void NetworkClient::SendRequest_SaveProfile(std::string profile_name)
reply_hdr.pkt_dev_idx = 0;
reply_hdr.pkt_id = NET_PACKET_ID_REQUEST_SAVE_PROFILE;
reply_hdr.pkt_size = profile_name.size();
reply_hdr.pkt_size = strlen(profile_name.c_str()) + 1;
send(client_sock, (char *)&reply_hdr, sizeof(NetPacketHeader), MSG_NOSIGNAL);
send(client_sock, (char *)profile_name.c_str(), reply_hdr.pkt_size, MSG_NOSIGNAL);
@ -902,7 +902,7 @@ void NetworkClient::SendRequest_DeleteProfile(std::string profile_name)
reply_hdr.pkt_dev_idx = 0;
reply_hdr.pkt_id = NET_PACKET_ID_REQUEST_DELETE_PROFILE;
reply_hdr.pkt_size = profile_name.size();
reply_hdr.pkt_size = strlen(profile_name.c_str()) + 1;
send(client_sock, (char *)&reply_hdr, sizeof(NetPacketHeader), MSG_NOSIGNAL);
send(client_sock, (char *)profile_name.c_str(), reply_hdr.pkt_size, MSG_NOSIGNAL);

Loading…
Cancel
Save