Home
last modified time | relevance | path

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

12345678910>>...18

/base/telephony/sms_mms/services/sms/gsm/
Dgsm_sms_tpdu_encode.cpp36 bool GsmSmsTpduEncode::EncodeSubmitPdu(SmsWriteBuffer &buffer, const struct SmsSubmit *pSubmit) in EncodeSubmitPdu() argument
42 EncodeSubmitTpduType(buffer, *pSubmit); in EncodeSubmitPdu()
45 if (!buffer.WriteByte(pSubmit->msgRef)) { in EncodeSubmitPdu()
58 if (buffer.data_ == nullptr || (buffer.GetIndex() + position) > buffer.GetSize()) { in EncodeSubmitPdu()
62 … if (memcpy_s(buffer.data_.get() + buffer.GetIndex(), position, address.data(), position) != EOK) { in EncodeSubmitPdu()
66 buffer.MoveForward(position); in EncodeSubmitPdu()
68 if (!buffer.WriteByte(pSubmit->pid)) { in EncodeSubmitPdu()
72 return EncodeSubmitPduPartData(buffer, pSubmit); in EncodeSubmitPdu()
75 bool GsmSmsTpduEncode::EncodeSubmitPduPartData(SmsWriteBuffer &buffer, const struct SmsSubmit *pSub… in EncodeSubmitPduPartData() argument
80 if (buffer.data_ == nullptr || (buffer.GetIndex() + HEX_VALUE_01) > buffer.GetSize()) { in EncodeSubmitPduPartData()
[all …]
Dgsm_user_data_encode.cpp40 bool GsmUserDataEncode::EncodeGsmPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *userData) in EncodeGsmPdu() argument
43 if (!EncodeGsmHeadPdu(buffer, userData, fillBits)) { in EncodeGsmPdu()
46 return EncodeGsmBodyPdu(buffer, userData, fillBits); in EncodeGsmPdu()
49 bool GsmUserDataEncode::EncodeGsmHeadPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *userDat… in EncodeGsmHeadPdu() argument
56 uint16_t location = buffer.GetIndex(); in EncodeGsmHeadPdu()
58 buffer.MoveForward(SLIDE_DATA_STEP); in EncodeGsmHeadPdu()
60 buffer.MoveForward(HEX_VALUE_01); in EncodeGsmHeadPdu()
62 uint16_t udhl = buffer.GetIndex(); in EncodeGsmHeadPdu()
64 userData_->EncodeHeader(buffer, userData->header[i]); in EncodeGsmHeadPdu()
67 if (buffer.GetIndex() > udhl) { in EncodeGsmHeadPdu()
[all …]
Dgsm_user_data_pdu.cpp32 SmsWriteBuffer &buffer, const struct SmsUDPackage *(&userData), DataCodingScheme scheme) in EncodeUserDataPdu() argument
47 result = encodePdu->EncodeGsmPdu(buffer, userData); in EncodeUserDataPdu()
50 result = encodePdu->Encode8bitPdu(buffer, userData); 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) { 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);
34 … SmsWriteBuffer &buffer, const struct SmsUDPackage *(&pUserData), DataCodingScheme codingScheme);
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 …]
Dgsm_user_data_encode.h27 bool EncodeGsmPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
28 bool Encode8bitPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
29 bool EncodeUcs2Pdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
32 …bool EncodeGsmHeadPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData, uint8_t &fillB…
33 …bool EncodeGsmBodyPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData, uint8_t fillBi…
34 bool Encode8bitHeadPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
35 bool Encode8bitBodyPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
36 bool EncodeUcs2HeadPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
37 bool EncodeUcs2BodyPdu(SmsWriteBuffer &buffer, const struct SmsUDPackage *pUserData);
/base/startup/init/test/unittest/param/
Dparam_shell_unittest.cpp69 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "cd const") != EOK) { in TestParamShellCmd()
72 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
75 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "cat aaa") != EOK) { in TestParamShellCmd()
78 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
81 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "testnotcmd") != EOK) { in TestParamShellCmd()
84 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
88 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), "\"ls") != EOK) { in TestParamShellCmd()
91 bshd->length = strlen(bshd->buffer); in TestParamShellCmd()
95 if (strcpy_s(bshd->buffer, sizeof(bshd->buffer), ",ls") != EOK) { in TestParamShellCmd()
98 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/update/updater/services/rust/hash_signed_data/src/
Dimg_hash_check.rs63 fn read_from_le_bytes(&mut self, buffer: &[u8]) -> bool; in read_from_le_bytes()
71 fn read_from_le_bytes(&mut self, buffer: &[u8]) -> bool { in read_from_le_bytes()
72 if buffer.len() < HASH_INFO_SIZE { in read_from_le_bytes()
73 updaterlog!(ERROR, "{} buffer is too small. {}", line!(), buffer.len()); in read_from_le_bytes()
77 self.tlv_type = u16::from_le_bytes(buffer[0..2].try_into().unwrap()); in read_from_le_bytes()
78 self.tlv_len = u32::from_le_bytes(buffer[2..6].try_into().unwrap()); in read_from_le_bytes()
79 self.algorithm = u16::from_le_bytes(buffer[6..8].try_into().unwrap()); in read_from_le_bytes()
80 self.algo_size = u16::from_le_bytes(buffer[8..10].try_into().unwrap()); in read_from_le_bytes()
81 self.component_count = u16::from_le_bytes(buffer[10..12].try_into().unwrap()); in read_from_le_bytes()
82 self.block_size = u32::from_le_bytes(buffer[12..16].try_into().unwrap()); in read_from_le_bytes()
[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/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/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/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/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/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/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/huks/test/unittest/huks_standard_test/module_test/utils_test/src/
Dhks_attest_utils_test.cpp67 uint8_t buffer[1] = { 0 }; variable
68 struct HksBlob key = { 1, buffer };
69 struct HksBlob oid = { 1, buffer };
70 struct HksAsn1Blob fakeBlob = { 0, 1, buffer };
85 uint8_t buffer[1] = { 0 }; variable
86 struct HksBlob key = { 1, buffer };
87 struct HksBlob oid = { 1, buffer };
88 struct HksAsn1Blob fakeBlob = { 0, 1, buffer };
101 uint8_t buffer[1] = { 0 }; variable
102 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()
49 delete[] buffer; in SysEventServerFuzzTest()
/base/update/updater/test/unittest/applypatch_test/
Dstore_unittest.cpp46 std::vector<uint8_t> buffer(4096, 0); variable
49 Store::WriteDataToStore(storePath, filename1, buffer, 4096);
50 Store::WriteDataToStore(storePath, filename2, buffer, 4096);
51 Store::LoadDataFromStore(storePath, filename1, buffer);
53 Store::WriteDataToStore(storePath, filename1, buffer, 4096);
54 Store::WriteDataToStore(storePath, filename2, buffer, 4096);
61 std::vector<uint8_t> buffer(4096, 0); variable
62 EXPECT_EQ(Store::WriteDataToStore("", "test_file1", buffer, buffer.size()), -1);
68 std::vector<uint8_t> buffer(4096, 0); variable
72 EXPECT_EQ(Store::WriteDataToStore(storePath, filename1, buffer, -1), -1);
/base/hiviewdfx/hiview_lite/
Dhiview_cache.c23 boolean InitHiviewStaticCache(HiviewCache *cache, HiviewCacheType type, uint8 *buffer, uint16 size) in InitHiviewStaticCache() argument
31 cache->buffer = buffer; in InitHiviewStaticCache()
44 uint8 *buffer = (uint8 *)HIVIEW_MemAlloc(MEM_POOL_HIVIEW_ID, size); in InitHiviewCache() local
45 if (buffer == NULL) { in InitHiviewCache()
51 cache->buffer = buffer; in InitHiviewCache()
60 if (cache == NULL || data == NULL || cache->buffer == NULL) { in WriteToCache()
76 if (memcpy_s(cache->buffer + cache->wCursor, firstLen, data, firstLen) == EOK) { in WriteToCache()
87 … if (memcpy_s(cache->buffer + cache->wCursor, secondLen, data + firstLen, secondLen) == EOK) { in WriteToCache()
96 if (memcpy_s(cache->buffer + cache->wCursor, wLen, data, wLen) == EOK) { in WriteToCache()
111 if (cache == NULL || data == NULL || cache->buffer == NULL) { in ReadFromCache()
[all …]

12345678910>>...18