X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/79b9da22a1f4b26279940d285c1bc28ce4e99252..7e6b461318c8a779d91381531435a68ee4e8b6ed:/securityd/src/SharedMemoryServer.cpp diff --git a/securityd/src/SharedMemoryServer.cpp b/securityd/src/SharedMemoryServer.cpp index df1647ee..60176b1b 100644 --- a/securityd/src/SharedMemoryServer.cpp +++ b/securityd/src/SharedMemoryServer.cpp @@ -32,6 +32,7 @@ #include #include #include +#include /* Logically, these should go in /var/run/mds, but we know that /var/db/mds @@ -153,13 +154,13 @@ void SharedMemoryServer::WriteMessage (SegmentOffsetType domain, SegmentOffsetTy // assemble the final message ssize_t messageSize = kHeaderLength + messageLength; - u_int8_t finalMessage[messageSize]; - SegmentOffsetType *fm = (SegmentOffsetType*) finalMessage; + std::vector finalMessage(messageSize); + SegmentOffsetType *fm = (SegmentOffsetType*) finalMessage.data(); fm[0] = OSSwapHostToBigInt32(domain); fm[1] = OSSwapHostToBigInt32(event); memcpy(&fm[2], message, messageLength); - SegmentOffsetType crc = CalculateCRC(finalMessage, messageSize); + SegmentOffsetType crc = CalculateCRC(finalMessage.data(), messageSize); // write the length WriteOffset(int_cast(messageSize)); @@ -168,7 +169,7 @@ void SharedMemoryServer::WriteMessage (SegmentOffsetType domain, SegmentOffsetTy WriteOffset(crc); // write the data - WriteData (finalMessage, int_cast(messageSize)); + WriteData (finalMessage.data(), int_cast(messageSize)); // write the data count SetProducerOffset(int_cast(mDataPtr - mDataArea));