Merge pull request #6645 from eliblight/fix-memcpy

Fix memcpy of id from key to be slightly safer.
This commit is contained in:
Salvatore Sanfilippo 2019-12-05 16:51:42 +01:00 committed by GitHub
commit 7e24e219fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ void trackingInvalidateSlot(uint64_t slot) {
raxSeek(&ri,"^",NULL,0);
while(raxNext(&ri)) {
uint64_t id;
memcpy(&id,ri.key,ri.key_len);
memcpy(&id,ri.key,sizeof(id));
client *c = lookupClientByID(id);
if (c == NULL || !(c->flags & CLIENT_TRACKING)) continue;
sendTrackingMessage(c,slot);