Showing the changes to interface/src/DataServerClient.cpp (1 of 1 file). Show all
Unified · Split
| @@ -68,7 +68,7 @@ void DataServerClient::getValuesForKeysAndUUID(const QStringList& keys, const QU · 67 unmodified lines | ||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, const QString& userString) { |
| 71 | − if (!userString.isEmpty()) { | |
| 71 | + if (!userString.isEmpty() && keys.size() <= UCHAR_MAX) { | |
| 72 | 72 | unsigned char* getPacket = new unsigned char[MAX_PACKET_SIZE]; |
| 73 | 73 | |
| 74 | 74 | // setup the header for this packet |
| @@ -79,6 +79,9 @@ void DataServerClient::getValuesForKeysAndUserString(const QStringList& keys, co · 4 unmodified lines | ||
| 79 | 79 | numPacketBytes += userString.toLocal8Bit().size(); |
| 80 | 80 | getPacket[numPacketBytes++] = '\0'; |
| 81 | 81 | |
| 82 | + // pack one byte to designate the number of keys | |
| 83 | + getPacket[numPacketBytes++] = keys.size(); | |
| 84 | + | |
| 82 | 85 | for (int i = 0; i < keys.size(); ++i) { |
| 83 | 86 | // pack the keys, null terminated |
| 84 | 87 | strcpy((char*) getPacket + numPacketBytes, keys[i].toLocal8Bit().constData()); |