Skip to content

Commit eee15ee

Browse files
theanalystesindril
authored andcommitted
MGM: geotree: Fix wrong memcpy invocation in FsId2NodeIdxMap
This structure allocates a char array [pStrLen + sizeof(tFastTreeIdx)] at size; the first pStrLen * size is reserved for the buffer and the rest is storing the indices The memcpy invocation however copied sizeof(char*) * pStreLen * pSize previously which would copy 8 times the intended size leading to hard to debug segfaults whereas it should be only copying pSize * pStrLen Fixes: EOS-6506 Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@cern.ch>
1 parent 159e07b commit eee15ee

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mgm/geotree/SchedulingFastTree.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public:
450450
dest->pSize = pSize;
451451
// copy the data
452452
memcpy(dest->pNodeIdxs, pNodeIdxs, sizeof(tFastTreeIdx)*pSize);
453-
memcpy(dest->pBuffer, pBuffer, sizeof(char*)*pSize * pStrLen);
453+
memcpy(dest->pBuffer, pBuffer, sizeof(char) * pSize * pStrLen);
454454
return 0;
455455
}
456456

0 commit comments

Comments
 (0)