Unverified Commit 7e24e219 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #6645 from eliblight/fix-memcpy

Fix memcpy of id from key to be slightly safer.
parents 2271cf03 08c3fe80
...@@ -164,7 +164,7 @@ void trackingInvalidateSlot(uint64_t slot) { ...@@ -164,7 +164,7 @@ void trackingInvalidateSlot(uint64_t slot) {
raxSeek(&ri,"^",NULL,0); raxSeek(&ri,"^",NULL,0);
while(raxNext(&ri)) { while(raxNext(&ri)) {
uint64_t id; uint64_t id;
memcpy(&id,ri.key,ri.key_len); memcpy(&id,ri.key,sizeof(id));
client *c = lookupClientByID(id); client *c = lookupClientByID(id);
if (c == NULL || !(c->flags & CLIENT_TRACKING)) continue; if (c == NULL || !(c->flags & CLIENT_TRACKING)) continue;
sendTrackingMessage(c,slot); sendTrackingMessage(c,slot);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment