Lines 481-487
Link Here
|
481 |
char* buffer = static_cast<char*>(outputBlock.GetBuffer()); |
481 |
char* buffer = static_cast<char*>(outputBlock.GetBuffer()); |
482 |
|
482 |
|
483 |
// Add the path name for the symbolic link, and add 0 termination |
483 |
// Add the path name for the symbolic link, and add 0 termination |
484 |
std::memcpy(buffer+oldSize, linkedTo, linkedToSize); |
484 |
::memcpy(buffer+oldSize, linkedTo, linkedToSize); |
485 |
buffer[oldSize+linkedToSize] = '\0'; |
485 |
buffer[oldSize+linkedToSize] = '\0'; |
486 |
} |
486 |
} |
487 |
#endif |
487 |
#endif |
Lines 549-557
Link Here
|
549 |
|
549 |
|
550 |
// Store length and text for attibute name |
550 |
// Store length and text for attibute name |
551 |
u_int16_t keyLength = htons(attrKey.size()+1); |
551 |
u_int16_t keyLength = htons(attrKey.size()+1); |
552 |
std::memcpy(buffer+xattrSize, &keyLength, sizeof(u_int16_t)); |
552 |
::memcpy(buffer+xattrSize, &keyLength, sizeof(u_int16_t)); |
553 |
xattrSize += sizeof(u_int16_t); |
553 |
xattrSize += sizeof(u_int16_t); |
554 |
std::memcpy(buffer+xattrSize, attrKey.c_str(), attrKey.size()+1); |
554 |
::memcpy(buffer+xattrSize, attrKey.c_str(), attrKey.size()+1); |
555 |
xattrSize += attrKey.size()+1; |
555 |
xattrSize += attrKey.size()+1; |
556 |
|
556 |
|
557 |
// Leave space for value size |
557 |
// Leave space for value size |
Lines 584-595
Link Here
|
584 |
|
584 |
|
585 |
// Fill in value size |
585 |
// Fill in value size |
586 |
u_int32_t valueLength = htonl(valueSize); |
586 |
u_int32_t valueLength = htonl(valueSize); |
587 |
std::memcpy(buffer+valueSizeOffset, &valueLength, sizeof(u_int32_t)); |
587 |
::memcpy(buffer+valueSizeOffset, &valueLength, sizeof(u_int32_t)); |
588 |
} |
588 |
} |
589 |
|
589 |
|
590 |
// Fill in attribute block size |
590 |
// Fill in attribute block size |
591 |
u_int32_t xattrBlockLength = htonl(xattrSize-xattrBlockSizeOffset-sizeof(u_int32_t)); |
591 |
u_int32_t xattrBlockLength = htonl(xattrSize-xattrBlockSizeOffset-sizeof(u_int32_t)); |
592 |
std::memcpy(buffer+xattrBlockSizeOffset, &xattrBlockLength, sizeof(u_int32_t)); |
592 |
::memcpy(buffer+xattrBlockSizeOffset, &xattrBlockLength, sizeof(u_int32_t)); |
593 |
|
593 |
|
594 |
outputBlock.ResizeBlock(xattrSize); |
594 |
outputBlock.ResizeBlock(xattrSize); |
595 |
} |
595 |
} |
Lines 676-682
Link Here
|
676 |
} |
676 |
} |
677 |
#endif |
677 |
#endif |
678 |
|
678 |
|
679 |
xattrOffset += std::strlen(reinterpret_cast<char*>(pattr+1))+1; |
679 |
xattrOffset += ::strlen(reinterpret_cast<char*>(pattr+1))+1; |
680 |
} |
680 |
} |
681 |
|
681 |
|
682 |
// If working as root, set user IDs |
682 |
// If working as root, set user IDs |
Lines 817-823
Link Here
|
817 |
const char* buffer = static_cast<char*>(mpClearAttributes->GetBuffer()); |
817 |
const char* buffer = static_cast<char*>(mpClearAttributes->GetBuffer()); |
818 |
|
818 |
|
819 |
u_int32_t xattrBlockLength = 0; |
819 |
u_int32_t xattrBlockLength = 0; |
820 |
std::memcpy(&xattrBlockLength, buffer+xattrOffset, sizeof(u_int32_t)); |
820 |
::memcpy(&xattrBlockLength, buffer+xattrOffset, sizeof(u_int32_t)); |
821 |
int xattrBlockSize = ntohl(xattrBlockLength); |
821 |
int xattrBlockSize = ntohl(xattrBlockLength); |
822 |
xattrOffset += sizeof(u_int32_t); |
822 |
xattrOffset += sizeof(u_int32_t); |
823 |
|
823 |
|
Lines 831-837
Link Here
|
831 |
while(xattrOffset<xattrEnd) |
831 |
while(xattrOffset<xattrEnd) |
832 |
{ |
832 |
{ |
833 |
u_int16_t keyLength = 0; |
833 |
u_int16_t keyLength = 0; |
834 |
std::memcpy(&keyLength, buffer+xattrOffset, sizeof(u_int16_t)); |
834 |
::memcpy(&keyLength, buffer+xattrOffset, sizeof(u_int16_t)); |
835 |
int keySize = ntohs(keyLength); |
835 |
int keySize = ntohs(keyLength); |
836 |
xattrOffset += sizeof(u_int16_t); |
836 |
xattrOffset += sizeof(u_int16_t); |
837 |
|
837 |
|
Lines 839-845
Link Here
|
839 |
xattrOffset += keySize; |
839 |
xattrOffset += keySize; |
840 |
|
840 |
|
841 |
u_int32_t valueLength = 0; |
841 |
u_int32_t valueLength = 0; |
842 |
std::memcpy(&valueLength, buffer+xattrOffset, sizeof(u_int32_t)); |
842 |
::memcpy(&valueLength, buffer+xattrOffset, sizeof(u_int32_t)); |
843 |
int valueSize = ntohl(valueLength); |
843 |
int valueSize = ntohl(valueLength); |
844 |
xattrOffset += sizeof(u_int32_t); |
844 |
xattrOffset += sizeof(u_int32_t); |
845 |
|
845 |
|