diff options
Diffstat (limited to 'src/usr/hwas/common')
-rw-r--r-- | src/usr/hwas/common/hwasCallout.C | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/usr/hwas/common/hwasCallout.C b/src/usr/hwas/common/hwasCallout.C index fd766bc5a..78153fb00 100644 --- a/src/usr/hwas/common/hwasCallout.C +++ b/src/usr/hwas/common/hwasCallout.C @@ -57,11 +57,11 @@ bool retrieveTarget(uint8_t * & io_uData, { // convert the EntityPath to a Target pointer TARGETING::EntityPath ep, *ep_ptr; - uint32_t size; ep_ptr = (TARGETING::EntityPath *)io_uData; - size = TARGETING::EntityPath::MAX_PATH_ELEMENTS - ep_ptr->size(); - size *= sizeof(TARGETING::EntityPath::PathElement); - size = sizeof(ep) - size; + // size is total EntityPath size minus unused path elements + uint32_t size = sizeof(*ep_ptr) - + (TARGETING::EntityPath::MAX_PATH_ELEMENTS - ep_ptr->size()) * + sizeof(TARGETING::EntityPath::PathElement); memcpy(&ep, io_uData, size); o_pTarget = TARGETING::targetService().toTarget(ep); io_uData += size; |