Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 622) sorted by relevance

12345678910>>...25

/base/telephony/sms_mms/services/sms/gsm/
Dgsm_sms_tpdu_encode.cpp38 bool GsmSmsTpduEncode::EncodeSubmitPdu(SmsWriteBuffer &buffer, const struct SmsSubmit *pSubmit) in EncodeSubmitPdu() argument
44 EncodeSubmitTpduType(buffer, *pSubmit); in EncodeSubmitPdu()
47 if (!buffer.WriteByte(pSubmit->msgRef)) { in EncodeSubmitPdu()
60 if (buffer.data_ == nullptr || (buffer.GetIndex() + position) > buffer.GetSize()) { in EncodeSubmitPdu()
64 … if (memcpy_s(buffer.data_.get() + buffer.GetIndex(), position, address.data(), position) != EOK) { in EncodeSubmitPdu()
68 buffer.MoveForward(position); in EncodeSubmitPdu()
70 if (!buffer.WriteByte(pSubmit->pid)) { in EncodeSubmitPdu()
74 return EncodeSubmitPduPartData(buffer, pSubmit); in EncodeSubmitPdu()
77 bool GsmSmsTpduEncode::EncodeSubmitPduPartData(SmsWriteBuffer &buffer, const struct SmsSubmit *pSub… in EncodeSubmitPduPartData() argument
82 if (buffer.data_ == nullptr || (buffer.GetIndex() + HEX_VALUE_01) > buffer.GetSize()) { in EncodeSubmitPduPartData()
[all …]
Dgsm_user_data_encode.cpp41 bool GsmUserDataEncode::EncodeGsmPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *userData) in EncodeGsmPdu() argument
44 if (!EncodeGsmHeadPdu(buffer, userData, fillBits)) { in EncodeGsmPdu()
47 return EncodeGsmBodyPdu(buffer, userData, fillBits); in EncodeGsmPdu()
50 bool GsmUserDataEncode::EncodeGsmHeadPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *userDat… in EncodeGsmHeadPdu() argument
57 uint16_t location = buffer.GetIndex(); in EncodeGsmHeadPdu()
59 buffer.MoveForward(SLIDE_DATA_STEP); in EncodeGsmHeadPdu()
61 buffer.MoveForward(HEX_VALUE_01); in EncodeGsmHeadPdu()
63 uint16_t udhl = buffer.GetIndex(); in EncodeGsmHeadPdu()
65 userData_->EncodeHeader(buffer, userData->header[i]); in EncodeGsmHeadPdu()
68 if (buffer.GetIndex() > udhl) { in EncodeGsmHeadPdu()
[all …]
Dgsm_user_data_pdu.cpp32 …SmsWriteBuffer &buffer, const struct SmsUDPackage *(&userData), DataCodingScheme scheme, std::stri… in EncodeUserDataPdu() argument
47 result = encodePdu->EncodeGsmPdu(buffer, userData); in EncodeUserDataPdu()
50 result = encodePdu->Encode8bitPdu(buffer, userData, destAddr); in EncodeUserDataPdu()
53 result = encodePdu->EncodeUcs2Pdu(buffer, userData); in EncodeUserDataPdu()
63 SmsReadBuffer &buffer, bool bHeaderInd, DataCodingScheme scheme, struct SmsUDPackage *userData) in DecodeUserDataPdu() argument
84 result = decodePdu->DecodeGsmPdu(buffer, bHeaderInd, userData, nullptr); in DecodeUserDataPdu()
87 result = decodePdu->Decode8bitPdu(buffer, bHeaderInd, userData, nullptr); in DecodeUserDataPdu()
90 result = decodePdu->DecodeUcs2Pdu(buffer, bHeaderInd, userData, nullptr); in DecodeUserDataPdu()
99 bool GsmUserDataPdu::DecodeUserDataPdu(SmsReadBuffer &buffer, bool bHeaderInd, DataCodingScheme sch… in DecodeUserDataPdu() argument
121 result = decodePdu->DecodeGsmPdu(buffer, bHeaderInd, userData, pTPUD); in DecodeUserDataPdu()
[all …]
Dgsm_user_data_decode.cpp41 SmsReadBuffer &buffer, bool bHeaderInd, struct SmsUDPackage *userData, struct SmsTpud *pTPUD) in DecodeGsmPdu() argument
45 if (!DecodeGsmHeadPdu(buffer, bHeaderInd, userData, pTPUD, udl, fillBits)) { in DecodeGsmPdu()
49 return DecodeGsmBodyPdu(buffer, bHeaderInd, userData, pTPUD, udl, fillBits); in DecodeGsmPdu()
52 bool GsmUserDataDecode::DecodeGsmHeadPdu(SmsReadBuffer &buffer, bool bHeaderInd, struct SmsUDPackag… in DecodeGsmHeadPdu() argument
61 if (!buffer.ReadByte(udl)) { in DecodeGsmHeadPdu()
80 if (buffer.GetIndex() + udl >= buffer.GetSize()) { in DecodeGsmHeadPdu()
81 len = buffer.GetSize() - buffer.GetIndex(); in DecodeGsmHeadPdu()
83 if (buffer.data_ == nullptr || len > sizeof(pTPUD->ud)) { in DecodeGsmHeadPdu()
87 … if (memcpy_s(pTPUD->ud, sizeof(pTPUD->ud), buffer.data_.get() + buffer.GetIndex(), len) != EOK) { in DecodeGsmHeadPdu()
93 return DecodeGsmHeadPduPartData(buffer, bHeaderInd, userData, udl, fillBits); in DecodeGsmHeadPdu()
[all …]
Dgsm_sms_tpdu_decode.cpp36 bool GsmSmsTpduDecode::DecodeSubmit(SmsReadBuffer &buffer, struct SmsSubmit *submit) in DecodeSubmit() argument
43 tpdu_->DebugTpdu(buffer, PARSE_SUBMIT_TYPE); in DecodeSubmit()
46 if (!buffer.PickOneByte(oneByte)) { in DecodeSubmit()
56 if (!buffer.PickOneByte(oneByte)) { in DecodeSubmit()
62 if (!buffer.PickOneByte(oneByte)) { in DecodeSubmit()
72 if (!buffer.PickOneByte(oneByte)) { in DecodeSubmit()
81 return DecodeSubmitPartData(buffer, submit); in DecodeSubmit()
84 bool GsmSmsTpduDecode::DecodeSubmitPartData(SmsReadBuffer &buffer, struct SmsSubmit *submit) in DecodeSubmitPartData() argument
92 if (!buffer.PickOneByte(oneByte)) { in DecodeSubmitPartData()
101 buffer.MoveForward(1); in DecodeSubmitPartData()
[all …]
Dgsm_sms_common_utils.cpp32 bool GsmSmsCommonUtils::Pack7bitChar(SmsWriteBuffer &buffer, const uint8_t *userData, uint8_t dataL… in Pack7bitChar() argument
40 buffer.MoveForward(1); in Pack7bitChar()
45 if (!buffer.WriteByte(userData[srcIdx])) { in Pack7bitChar()
56 if (!Pack7bitCharPartData(buffer, userData, srcIdx, shift)) { in Pack7bitChar()
64 if (!buffer.GetValueFromIndex(buffer.GetIndex() - 1, oneByte)) { in Pack7bitChar()
69 if (!buffer.InsertByte(oneByte, (buffer.GetIndex() - 1))) { in Pack7bitChar()
81 SmsWriteBuffer &buffer, const uint8_t *userData, uint8_t &srcIdx, uint8_t &shift) in Pack7bitCharPartData() argument
84 if (!buffer.GetValueFromIndex(buffer.GetIndex() - 1, oneByte)) { in Pack7bitCharPartData()
89 if (!buffer.InsertByte(oneByte, (buffer.GetIndex() - 1))) { in Pack7bitCharPartData()
93 if (!buffer.GetTopValue(oneByte)) { in Pack7bitCharPartData()
[all …]
/base/update/updater/services/package/pkg_algorithm/
Dpkg_algo_digest.cpp51 int32_t Crc32Algorithm::Update(const PkgBuffer &buffer, size_t size) in Update() argument
53 if (buffer.buffer == nullptr) { in Update()
57 crc32_ = crc32(crc32_, buffer.buffer, size); in Update()
63 if (result.buffer == nullptr) { in Final()
71 WriteLE32(result.buffer, crc32_); in Final()
75 int32_t Crc32Algorithm::Calculate(PkgBuffer &result, const PkgBuffer &buffer, size_t size) in Calculate() argument
77 if (result.buffer == nullptr || buffer.buffer == nullptr) { in Calculate()
85 auto crc = reinterpret_cast<uint32_t *>(result.buffer); in Calculate()
87 *crc = crc32(*crc, buffer.buffer, size); in Calculate()
97 int32_t Sha256Algorithm::Update(const PkgBuffer &buffer, size_t size) in Update() argument
[all …]
/base/telephony/sms_mms/test/fuzztest/smspdubuffer_fuzzer/
Dsmspdubuffer_fuzzer.cpp28 auto buffer = std::make_unique<SmsReadBuffer>(strValue); in ReadBuffer() local
29 if (buffer == nullptr) { in ReadBuffer()
32 buffer->IsEmpty(); in ReadBuffer()
37 buffer->SetIndex(i); in ReadBuffer()
38 buffer->GetIndex(); in ReadBuffer()
41 buffer->MoveBack(i); in ReadBuffer()
44 buffer->MoveForward(i); in ReadBuffer()
47 buffer->SetIndex(0); in ReadBuffer()
51 buffer->ReadByte(v1); in ReadBuffer()
52 buffer->ReadWord(v2); in ReadBuffer()
[all …]
/base/telephony/sms_mms/services/sms/include/gsm/
Dgsm_user_data_pdu.h28 …SmsReadBuffer &buffer, bool bHeaderInd, DataCodingScheme CodingScheme, struct SmsUDPackage *pUserD…
29 bool DecodeUserDataPdu(SmsReadBuffer &buffer, bool bHeaderInd, DataCodingScheme CodingScheme,
31 bool DecodeHeader(SmsReadBuffer &buffer, struct SmsUDH &pHeader, uint16_t &headerLen);
33 bool EncodeUserDataPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *(&pUserData),
35 void EncodeHeader(SmsWriteBuffer &buffer, const struct SmsUDH header);
36 …bool GetHeaderCnt(SmsReadBuffer &buffer, struct SmsUDPackage *pUserData, uint8_t &udhl, uint16_t i…
40 bool DecodeHeaderPartData(SmsReadBuffer &buffer, struct SmsUDH &pHeader, uint8_t oneByte);
41 bool DecodeHeaderConcat8Bit(SmsReadBuffer &buffer, struct SmsUDH &pHeader);
42 bool DecodeHeaderConcat16Bit(SmsReadBuffer &buffer, struct SmsUDH &pHeader);
43 bool DecodeHeaderAppPort8Bit(SmsReadBuffer &buffer, struct SmsUDH &pHeader);
[all …]
Dgsm_sms_tpdu_encode.h29 bool EncodeSubmitPdu(SmsWriteBuffer &buffer, const struct SmsSubmit *pSubmit);
30 void EncodeSubmitTpduType(SmsWriteBuffer &buffer, const struct SmsSubmit &pSubmit);
31 bool EncodeDeliverPdu(SmsWriteBuffer &buffer, const struct SmsDeliver *pDeliver);
32 bool EncodeDeliverReportPdu(SmsWriteBuffer &buffer, const struct SmsDeliverReport *pDeliverRep);
33 bool EncodeStatusReportPdu(SmsWriteBuffer &buffer, const struct SmsStatusReport *pStatusRep);
36 bool EncodeSubmitPduPartData(SmsWriteBuffer &buffer, const struct SmsSubmit *pSubmit);
37 void EncodeSubmitTypePartData(SmsWriteBuffer &buffer, const struct SmsSubmit &pSubmit);
38 void EncodeSubmitTypeData(SmsWriteBuffer &buffer, const struct SmsSubmit &pSubmit);
39 bool EncodeDeliverPartData(SmsWriteBuffer &buffer, const struct SmsDeliver *pDeliver);
40 bool EncodeDeliverData(SmsWriteBuffer &buffer, const struct SmsDeliver *pDeliver);
[all …]
/base/startup/init/test/unittest/param/
Dparam_shell_unittest.cpp70 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "cd const") != EOK) { in TestParamShellCmd()
73 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
76 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "cat aaa") != EOK) { in TestParamShellCmd()
79 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
82 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "testnotcmd") != EOK) { in TestParamShellCmd()
85 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
89 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "\"ls") != EOK) { in TestParamShellCmd()
92 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
96 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), ",ls") != EOK) { in TestParamShellCmd()
99 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
[all …]
Dtrigger_unittest.cpp198 char buffer[triggerBuffer]; in TestCheckParamTrigger1() local
199 int ret = sprintf_s(buffer, sizeof(buffer), "%s=%s", param, value); in TestCheckParamTrigger1()
201 JobNode *node = AddTrigger(TRIGGER_PARAM, triggerName, buffer, 0); in TestCheckParamTrigger1()
206 ret = sprintf_s(buffer, sizeof(buffer), "%s=%s", param, "2"); in TestCheckParamTrigger1()
208 … CheckTrigger(GetTriggerWorkSpace(), TRIGGER_PARAM, buffer, strlen(buffer), TestTriggerExecute); in TestCheckParamTrigger1()
212 ret = sprintf_s(buffer, sizeof(buffer), "%s=%s", param, value); in TestCheckParamTrigger1()
214 … CheckTrigger(GetTriggerWorkSpace(), TRIGGER_PARAM, buffer, strlen(buffer), TestTriggerExecute); in TestCheckParamTrigger1()
220 ret = sprintf_s(buffer, sizeof(buffer), "%s=%s", "2222", value); in TestCheckParamTrigger1()
222 … CheckTrigger(GetTriggerWorkSpace(), TRIGGER_PARAM, buffer, strlen(buffer), TestTriggerExecute); in TestCheckParamTrigger1()
225 …CheckTrigger(GetTriggerWorkSpace(), TRIGGER_PARAM_WATCH, buffer, strlen(buffer), TestTriggerExecut… in TestCheckParamTrigger1()
[all …]
/base/tee/tee_client/services/authentication/
Dtcu_authentication.c124 static int GetFileInfo(int bufLen, uint8_t *buffer, const char *path) in GetFileInfo() argument
130 bool paramInvlid = ((buffer == NULL) || (path == NULL) || (IsNotValidFname(path) != 0) || in GetFileInfo()
143 fileSize = (int)fread(buffer, sizeof(char), (unsigned int)bufLen, fp); in GetFileInfo()
159 uint8_t *buffer = NULL; in InitTempBuf() local
164 return buffer; in InitTempBuf()
167 buffer = (uint8_t *)malloc((unsigned int)bufLen); in InitTempBuf()
168 if (buffer == NULL) { in InitTempBuf()
170 return buffer; in InitTempBuf()
173 ret = memset_s(buffer, (unsigned int)bufLen, 0, (unsigned int)bufLen); in InitTempBuf()
176 free(buffer); in InitTempBuf()
[all …]
Dtee_get_native_cert.c24 static int SetPathToBuf(uint8_t *buffer, uint32_t *len, uint32_t *inputLen, const char *path) in SetPathToBuf() argument
38 ret = memcpy_s(buffer, *inputLen, &pathLen, sizeof(pathLen)); in SetPathToBuf()
44 buffer += sizeof(pathLen); in SetPathToBuf()
54 ret = memcpy_s(buffer, *inputLen, path, num); in SetPathToBuf()
66 static int SetUidToBuf(uint8_t *buffer, uint32_t *len, uint32_t *inputLen, unsigned int caUid) in SetUidToBuf() argument
78 ret = memcpy_s(buffer, *inputLen, &pubkeyLen, sizeof(pubkeyLen)); in SetUidToBuf()
84 buffer += sizeof(pubkeyLen); in SetUidToBuf()
94 ret = memcpy_s(buffer, *inputLen, &caUid, pubkeyLen); in SetUidToBuf()
105 static int SetUserInfoToBuf(uint8_t *buffer, uint32_t *len, uint32_t *inputLen, unsigned int caUid) in SetUserInfoToBuf() argument
109 ret = SetUidToBuf(buffer, len, inputLen, caUid); in SetUserInfoToBuf()
[all …]
/base/telephony/sms_mms/test/gtest/
Dzero_branch_cdma_sms_test.cpp161 auto buffer = std::make_shared<SmsPduBuffer>(); variable
162 EXPECT_TRUE(buffer->IsEmpty());
163 EXPECT_EQ(buffer->GetIndex(), 0);
164 EXPECT_FALSE(buffer->SetIndex(1));
165 EXPECT_EQ(buffer->GetIndex(), 0);
166 EXPECT_TRUE(buffer->SetIndex(0));
167 EXPECT_EQ(buffer->GetIndex(), 0);
168 EXPECT_EQ(buffer->MoveForward(), 0);
169 EXPECT_EQ(buffer->MoveForward(1), 0);
170 EXPECT_EQ(buffer->MoveBack(), 0);
[all …]
/base/security/appverify/interfaces/innerkits/appverify_lite/src/
Dapp_centraldirectory.c34 if (hapBuffer == NULL || hapBuffer->buffer == NULL) { in HapPutByte()
38 *(char *)((char *)hapBuffer->buffer + offset) = value; in HapPutByte()
45 if (hapBuffer == NULL || hapBuffer->buffer == NULL) { in HapPutData()
49 …if (memcpy_s(((unsigned char *)hapBuffer->buffer + offset), (hapBuffer->len - offset), data, len) … in HapPutData()
55 void HapSetInt32(const HapBuf *buffer, int32_t offset, int32_t value) in HapSetInt32() argument
61 if (buffer == NULL || buffer->buffer == NULL) { in HapSetInt32()
64 if ((offset >= 0) && ((buffer->len - offset) >= (int)(sizeof(value)))) { in HapSetInt32()
65 HapPutInt32((unsigned char *)buffer->buffer + offset, buffer->len - offset, (int)(value)); in HapSetInt32()
76 hapBuffer->buffer = APPV_MALLOC(len); in CreateHapBuffer()
77 if (hapBuffer->buffer == NULL) { in CreateHapBuffer()
[all …]
/base/update/updater/services/rust/hash_signed_data/src/
Dimg_hash_check.rs39 fn read_le_bytes(buffer: &[u8]) -> Self; in read_le_bytes()
43 fn read_le_bytes(buffer: &[u8]) -> Self { in read_le_bytes()
44 u32::from_le_bytes(buffer[..].try_into().unwrap()) in read_le_bytes()
49 fn read_le_bytes(buffer: &[u8]) -> Self { in read_le_bytes()
50 u64::from_le_bytes(buffer[..].try_into().unwrap()) in read_le_bytes()
88 fn read_from_le_bytes(&mut self, buffer: &[u8]) -> bool; in read_from_le_bytes()
96 fn read_from_le_bytes(&mut self, buffer: &[u8]) -> bool { in read_from_le_bytes()
97 if buffer.len() < HASH_INFO_SIZE { in read_from_le_bytes()
98 updaterlog!(ERROR, "{} buffer is too small. {}", line!(), buffer.len()); in read_from_le_bytes()
102 self.tlv_type = u16::from_le_bytes(buffer[0..2].try_into().unwrap()); in read_from_le_bytes()
[all …]
/base/startup/appspawn/modules/sandbox/
Dsandbox_expand.c60 int len = sprintf_s(context->buffer[0].buffer, context->buffer[0].bufferLen, "%s%s/%s/%s", in MountAllHsp()
64 len = sprintf_s(context->buffer[1].buffer, context->buffer[1].bufferLen, "%s%s%s/%s", in MountAllHsp()
68 CreateSandboxDir(context->buffer[1].buffer, FILE_MODE); in MountAllHsp()
70 … context->buffer[0].buffer, context->buffer[1].buffer, NULL, MS_REC | MS_BIND, NULL, MS_SLAVE in MountAllHsp()
107 int len = sprintf_s(context->buffer[0].buffer, context->buffer[0].bufferLen, "%s%s%s", in MountAllGroup()
110 …LOGV("MountAllGroup src: '%{public}s' =>'%{public}s'", libPhysicalPath, context->buffer[0].buffer); in MountAllGroup()
112 CreateSandboxDir(context->buffer[0].buffer, FILE_MODE); in MountAllGroup()
113 …MountArg mountArg = {libPhysicalPath, context->buffer[0].buffer, NULL, MS_REC | MS_BIND, NULL, MS_… in MountAllGroup()
137 int ret = strncpy_s(sandboxContext->buffer[0].buffer, in SetOverlayAppPath()
138 sandboxContext->buffer[0].bufferLen, hapPath, tmp - (char *)hapPath); in SetOverlayAppPath()
[all …]
/base/startup/init/services/modules/init_context/
Dinit_context.c45 static void HandleRecvMessage(SubInitInfo *subInfo, char *buffer, uint32_t size);
119 static char buffer[MAX_CMD_LEN] = {0}; in SubInitExecuteCmd() local
127 len = snprintf_s(buffer, sizeof(buffer), sizeof(buffer) - 1, "%s %s", name, cmdContent); in SubInitExecuteCmd()
129 len = snprintf_s(buffer, sizeof(buffer), sizeof(buffer) - 1, "%s ", name); in SubInitExecuteCmd()
132 buffer[len] = '\0'; in SubInitExecuteCmd()
133 PLUGIN_LOGV("send cmd '%s'", buffer); in SubInitExecuteCmd()
134 int ret = send(subInfo->sendFd, buffer, len, 0); in SubInitExecuteCmd()
138 ssize_t rLen = TEMP_FAILURE_RETRY(read(subInfo->recvFd, buffer, sizeof(buffer))); in SubInitExecuteCmd()
140 rLen = TEMP_FAILURE_RETRY(read(subInfo->recvFd, buffer, sizeof(buffer))); in SubInitExecuteCmd()
142 PLUGIN_CHECK(rLen >= 0 && rLen < sizeof(buffer), return errno, in SubInitExecuteCmd()
[all …]
/base/update/updater/services/package/pkg_package/
Dpkg_gzipfile.cpp65 void GZipFileEntry::GetUpGradeCompInfo(size_t &offset, PkgBuffer &buffer) in GetUpGradeCompInfo() argument
67 GZipHeader *header = (GZipHeader *)buffer.buffer; in GetUpGradeCompInfo()
76 WriteLE16(buffer.buffer + offset, EXTRA_FIELD_LEN); in GetUpGradeCompInfo()
84 … fileInfo_.fileInfo.identity, {buffer.buffer + offset, buffer.length - offset}, fileNameLen); in GetUpGradeCompInfo()
86 buffer.buffer[offset] = 0; in GetUpGradeCompInfo()
94 … fileInfo_.fileInfo.identity, {buffer.buffer + offset, buffer.length - offset}, fileNameLen); in GetUpGradeCompInfo()
96 buffer.buffer[offset] = 0; in GetUpGradeCompInfo()
111 PkgBuffer buffer(BUFFER_SIZE); in EncodeHeader() local
113 GetUpGradeCompInfo(offset, buffer); in EncodeHeader()
117 int32_t ret = outStream->Write(buffer, offset, startOffset); in EncodeHeader()
[all …]
/base/security/appverify/interfaces/innerkits/appverify/src/common/
Dhap_byte_buffer.cpp27 HapByteBuffer::HapByteBuffer() : buffer(nullptr), position(0), limit(0), capacity(0) in HapByteBuffer()
31 HapByteBuffer::HapByteBuffer(int32_t bufferCapacity) : buffer(nullptr), position(0), limit(0), capa… in HapByteBuffer()
36 HapByteBuffer::HapByteBuffer(const HapByteBuffer& other) : buffer(nullptr), position(0), limit(0), … in HapByteBuffer()
39 if (buffer != nullptr && capacity > 0) { in HapByteBuffer()
40 if (memcpy_s(buffer.get(), capacity, other.GetBufferPtr(), other.GetCapacity()) != EOK) { in HapByteBuffer()
51 buffer.reset(nullptr); in ~HapByteBuffer()
57 buffer = std::make_unique<char[]>(bufferCapacity); in Init()
58 if (buffer != nullptr) { in Init()
73 buffer.reset(nullptr); in operator =()
75 if (buffer != nullptr && other.GetBufferPtr() != nullptr && capacity > 0) { in operator =()
[all …]
/base/startup/init/services/loopevent/task/
Dle_task.c63 LE_Buffer *buffer = GetFirstBuffer(stream); in CloseTask() local
64 while (buffer) { in CloseTask()
65 FreeBuffer(loopHandle, stream, (BufferHandle)buffer); in CloseTask()
66 buffer = GetFirstBuffer(stream); in CloseTask()
77 LE_Buffer *buffer = NULL; in CreateBuffer() local
78 LE_CHECK((buffer = (LE_Buffer *)malloc(sizeof(LE_Buffer) + bufferSize)) != NULL, in CreateBuffer()
80 OH_ListInit(&buffer->node); in CreateBuffer()
81 buffer->buffSize = bufferSize; in CreateBuffer()
82 buffer->dataSize = 0; in CreateBuffer()
83 return buffer; in CreateBuffer()
[all …]
/base/security/device_security_level/baselib/utils/src/
Dutils_tlv.c26 static uint8_t *GetNextTlv(const uint8_t *buffer) in GetNextTlv() argument
28 return (uint8_t *)buffer + ((TlvCommon *)buffer)->len + TLV_TLV_HEAD_LEN; in GetNextTlv()
31 static uint8_t *ParseTlv(const uint8_t *buffer, TlvCommon *tlv, const uint8_t *boundary, uint32_t *… in ParseTlv() argument
33 if (buffer + TLV_TLV_HEAD_LEN > boundary) { in ParseTlv()
37 if (GetNextTlv(buffer) > boundary) { in ParseTlv()
41 tlv->tag = ((TlvCommon *)buffer)->tag; in ParseTlv()
42 tlv->len = ((TlvCommon *)buffer)->len; in ParseTlv()
43 tlv->value = (uint8_t *)buffer + TLV_TLV_HEAD_LEN; in ParseTlv()
45 return GetNextTlv(buffer); in ParseTlv()
48 static uint8_t *AppendTlv(uint8_t *buffer, const TlvCommon *tlv, const uint8_t *boundary, uint32_t … in AppendTlv() argument
[all …]
/base/security/huks/test/unittest/huks_standard_test/module_test/utils_test/src/
Dhks_attest_utils_test.cpp65 uint8_t buffer[1] = { 0 }; variable
66 struct HksBlob key = { 1, buffer };
67 struct HksBlob oid = { 1, buffer };
68 struct HksAsn1Blob fakeBlob = { 0, 1, buffer };
83 uint8_t buffer[1] = { 0 }; variable
84 struct HksBlob key = { 1, buffer };
85 struct HksBlob oid = { 1, buffer };
86 struct HksAsn1Blob fakeBlob = { 0, 1, buffer };
99 uint8_t buffer[1] = { 0 }; variable
100 struct HksBlob key = { 1, buffer };
[all …]
/base/hiviewdfx/hiview/plugins/sysevent_source/test/fuzztest/common/eventserver_fuzzer/
Deventserver_fuzzer.cpp35 char* buffer = new char[BUFFER_SIZE](); in SysEventServerFuzzTest() local
36 if (memcpy_s(buffer, BUFFER_SIZE, data, size) != EOK) { in SysEventServerFuzzTest()
37 delete[] buffer; in SysEventServerFuzzTest()
40 buffer[size] = 0; in SysEventServerFuzzTest()
41 int32_t dataByteCnt = *(reinterpret_cast<int32_t*>(buffer)); in SysEventServerFuzzTest()
43 delete[] buffer; in SysEventServerFuzzTest()
46 EventRaw::DecodedEvent event(reinterpret_cast<uint8_t*>(buffer)); in SysEventServerFuzzTest()
48 delete[] buffer; in SysEventServerFuzzTest()

12345678910>>...25