History

send an empty key when making a UUID request

Stephen Birarda committed 13 years ago

Commit ae59ce21 parent 85edb932 files · +7 −3Browse files

Showing the changes to interface/src/DataServerClient.cpp (1 of 2 files). Show all

Unified · Split

interface/src/DataServerClient.cpp+6−2
@@ -78,8 +78,12 @@ void DataServerClient::getValueForKeyAndUserString(const char* key, QString& use · 77 unmodified lines
7878
7979 // pack the key, null terminated
8080 strcpy((char*) getPacket + numPacketBytes, key);
81− numPacketBytes += strlen(key);
82− getPacket[numPacketBytes++] = '\0';
81+ int numKeyBytes = strlen(key);
82+
83+ if (numKeyBytes > 0) {
84+ numPacketBytes += numKeyBytes;
85+ getPacket[numPacketBytes++] = '\0';
86+ }
8387
8488 // add the getPacket to our vector of uncofirmed packets, will be deleted once we get a response from the nameserver
8589 _unmatchedPackets.insert(std::pair<unsigned char*, int>(getPacket, numPacketBytes));