Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 265) sorted by relevance

1234567891011

/base/security/appverify/interfaces/innerkits/appverify_lite/src/
Dapp_common.c18 long long HapGetInt64(const unsigned char *buf, int len) in HapGetInt64() argument
20 if (buf == NULL) { in HapGetInt64()
28 value = (value << BYTE_BITS) | (*(buf + len)); in HapGetInt64()
33 int HapGetInt(const unsigned char *buf, int len) in HapGetInt() argument
35 unsigned int value = HapGetUnsignedInt(buf, len); in HapGetInt()
39 unsigned int HapGetUnsignedInt(const unsigned char *buf, int len) in HapGetUnsignedInt() argument
41 if (buf == NULL) { in HapGetUnsignedInt()
49 value = (value << BYTE_BITS) | (*(buf + len)); in HapGetUnsignedInt()
54 short HapGetShort(const unsigned char *buf, int len) in HapGetShort() argument
56 if (buf == NULL) { in HapGetShort()
[all …]
/base/security/selinux/interfaces/policycoreutils/src/
Dselinux_log.c41 char *buf = (char *)malloc(MAX_LOG_BUFF_LEN); in SelinuxHilog() local
42 if (buf == NULL) { in SelinuxHilog()
46 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in SelinuxHilog()
50 if (vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, fmt, ap) < 0) { in SelinuxHilog()
52 free(buf); in SelinuxHilog()
53 buf = NULL; in SelinuxHilog()
61 HILOG_INFO(LOG_CORE, "%{public}s\n", buf); in SelinuxHilog()
64 HILOG_WARN(LOG_CORE, "%{public}s\n", buf); in SelinuxHilog()
68 HILOG_ERROR(LOG_CORE, "%{public}s\n", buf); in SelinuxHilog()
71 free(buf); in SelinuxHilog()
[all …]
/base/security/huks/frameworks/crypto_lite/cipher/src/
Dcipher_log_lite.c27 char *buf = (char *)malloc(MAX_LOG_BUFF_LEN); in CipherLog() local
28 if (buf == NULL) { in CipherLog()
32 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in CipherLog()
36 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in CipherLog()
40 free(buf); in CipherLog()
41 buf = NULL; in CipherLog()
48 HILOG_ERROR(HILOG_MODULE_SCY, "%s[%u]: %s\n", funcName, lineNo, buf); in CipherLog()
50 … HILOG_ERROR(HILOG_MODULE_SCY, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CipherLog()
54 free(buf); in CipherLog()
55 buf = NULL; in CipherLog()
[all …]
Dcipher_log.c26 char *buf = (char *)malloc(MAX_LOG_BUFF_LEN); in CipherLog() local
27 if (buf == NULL) { in CipherLog()
31 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in CipherLog()
35 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in CipherLog()
39 free(buf); in CipherLog()
40 buf = NULL; in CipherLog()
46 HILOG_ERROR(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CipherLog()
49 free(buf); in CipherLog()
50 buf = NULL; in CipherLog()
54 free(buf); in CipherLog()
[all …]
/base/hiviewdfx/faultloggerd/tools/process_dump/
Ddfx_regs_arm64.cpp119 char buf[REGS_PRINT_LEN_ARM64] = {0}; in PrintRegs() local
125 PrintFormat(buf, sizeof(buf), "x0:%016lx x1:%016lx x2:%016lx x3:%016lx\n", \ in PrintRegs()
128 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x4:%016lx x5:%016lx x6:%016lx x7:%016lx… in PrintRegs()
131 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x8:%016lx x9:%016lx x10:%016lx x11:%016… in PrintRegs()
134 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x12:%016lx x13:%016lx x14:%016lx x15:%0… in PrintRegs()
137 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x16:%016lx x17:%016lx x18:%016lx x19:%0… in PrintRegs()
140 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x20:%016lx x21:%016lx x22:%016lx x23:%0… in PrintRegs()
143 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x24:%016lx x25:%016lx x26:%016lx x27:%0… in PrintRegs()
146 PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "x28:%016lx x29:%016lx\n", \ in PrintRegs()
149 PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "lr:%016lx sp:%016lx pc:%016lx\n", \ in PrintRegs()
[all …]
Ddfx_signal.cpp75 char buf[LOG_BUF_LEN] = {0}; in PrintSignal() local
77 …int ret = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "Signal:%s(%s)", FormatSignalName(info.si_… in PrintSignal()
82 sigString = sigString + std::string(buf); in PrintSignal()
83 ret = memset_s(buf, LOG_BUF_LEN, '\0', LOG_BUF_LEN); in PrintSignal()
91 ret = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "@%018p ", (uint64_t)info.si_addr); in PrintSignal()
93 ret = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "@%010p ", (uint32_t)info.si_addr); in PrintSignal()
98 sigString = sigString + std::string(buf); in PrintSignal()
99 ret = memset_s(buf, LOG_BUF_LEN, '\0', LOG_BUF_LEN); in PrintSignal()
106 ret = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1, "from:%d:%d", info.si_pid, info.si_uid); in PrintSignal()
110 sigString = sigString + std::string(buf); in PrintSignal()
Ddfx_regs_arm.cpp90 char buf[REGS_PRINT_LEN_ARM] = {0}; in PrintRegs() local
96 PrintFormat(buf, sizeof(buf), "r0:%08x r1:%08x r2:%08x r3:%08x\n", \ in PrintRegs()
99 PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "r4:%08x r5:%08x r6:%08x r7:%08x\n", \ in PrintRegs()
102 PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "r8:%08x r9:%08x r10:%08x\n", \ in PrintRegs()
105 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), "fp:%08x ip:%08x sp:%08x lr:%08x pc:%08x… in PrintRegs()
108 regString = regString + std::string(buf); in PrintRegs()
Ddfx_regs_x86_64.cpp80 char buf[REGS_PRINT_LEN_X86] = {0}; in PrintRegs() local
86 PrintFormat(buf, sizeof(buf), " rax:%016lx rdx:%016lx rcx:%016lx rbx:%016lx\n", \ in PrintRegs()
89 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), " rsi:%016lx rdi:%016lx rbp:%016lx rsp:… in PrintRegs()
92 …PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), " r8:%016lx r9:%016lx r10:%016lx r11:%0… in PrintRegs()
95 PrintFormat(buf + strlen(buf), sizeof(buf) - strlen(buf), \ in PrintRegs()
99 regString = regString + std::string(buf); in PrintRegs()
Ddfx_ring_buffer_wrapper.cpp83 char buf[LOG_BUF_LEN] = {0}; in AppendBuf() local
84 (void)memset_s(&buf, sizeof(buf), 0, sizeof(buf)); in AppendBuf()
87 ret = vsnprintf_s(buf, sizeof(buf), sizeof(buf) - 1, format, args); in AppendBuf()
93 AppendMsg(std::string(buf)); in AppendBuf()
123 int DfxRingBufferWrapper::DefaultWrite(int32_t fd, const char *buf, const int len) in DefaultWrite() argument
125 if (buf == nullptr) { in DefaultWrite()
128 WriteLog(UNUSED_FD, "%s", buf); in DefaultWrite()
130 return write(fd, buf, len); in DefaultWrite()
Ddfx_logger.cpp34 char buf[WRITE_LOG_BUF_LEN] = {0}; in WriteLog() local
37 ret = vsnprintf_s(buf, sizeof(buf), sizeof(buf) - 1, format, args); in WriteLog()
44 fprintf(stderr, "%s", buf); in WriteLog()
48 ret = dprintf(fd, "%s", buf); in WriteLog()
50 DfxLogError("WriteLog :: write msg(%s) to fd(%d) failed, ret(%d).", buf, fd, ret); in WriteLog()
53 ret = DfxLogWarn(buf); in WriteLog()
55 ret = DfxLogDebug(buf); in WriteLog()
/base/security/certificate_manager/frameworks/cert_manager_standard/main/os_dependency/log/
Dcm_log.c32 char *buf = (char *)CmMalloc(MAX_LOG_BUFF_LEN); in CmLog() local
33 if (buf == NULL) { in CmLog()
37 (void)memset_s(buf, MAX_LOG_BUFF_LEN, 0, MAX_LOG_BUFF_LEN); in CmLog()
41 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in CmLog()
45 CM_FREE_PTR(buf); in CmLog()
51 HILOG_INFO(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CmLog()
54 HILOG_ERROR(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CmLog()
57 HILOG_WARN(LOG_CORE, "%{public}s[%{public}u]: %{public}s\n", funcName, lineNo, buf); in CmLog()
60 HILOG_DEBUG(LOG_CORE, "%{public}s[%{public}u]: %{private}s\n", funcName, lineNo, buf); in CmLog()
63 CM_FREE_PTR(buf); in CmLog()
[all …]
/base/security/huks/services/huks_standard/huks_engine/main/core/src/
Dhks_asn1.c59 static int32_t Asn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blo… in Asn1InsertValue() argument
74 if (buf->size < outSize) { in Asn1InsertValue()
75 …HKS_LOG_E("output buffer too small: %" LOG_PUBLIC "u. expected%" LOG_PUBLIC "u", buf->size, outSiz… in Asn1InsertValue()
79 … if (memmove_s(buf->data + header.size, buf->size - header.size, value.data, value.size) != EOK) { in Asn1InsertValue()
83 (void)memcpy_s(buf->data, buf->size, header.data, header.size); in Asn1InsertValue()
84 buf->data += outSize; in Asn1InsertValue()
85 buf->size -= outSize; in Asn1InsertValue()
88 obj->header.data = buf->data; in Asn1InsertValue()
91 obj->value.data = buf->data + header.size; in Asn1InsertValue()
98 int32_t HksAsn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blob *t… in HksAsn1InsertValue() argument
[all …]
/base/security/appverify/interfaces/innerkits/appverify_lite/include/
Dapp_common.h96 #define APPV_FREE(buf) \ argument
98 if ((buf) != NULL) { \
99 free(buf); \
100 (buf) = NULL; \
104 long long HapGetInt64(const unsigned char *buf, int len);
105 int HapGetInt(const unsigned char *buf, int len);
106 unsigned int HapGetUnsignedInt(const unsigned char *buf, int len);
107 short HapGetShort(const unsigned char *buf, int len);
108 void HapPutInt32(unsigned char *buf, int len, int value);
/base/hiviewdfx/faultloggerd/common/dfxlog/
Ddfx_log.cpp81 char buf[LOG_BUF_LEN] = {0}; in DfxLog() local
84 ret = vsnprintf_s(buf, sizeof(buf), sizeof(buf) - 1, fmt, args); in DfxLog()
90 HiLogBasePrint(LOG_CORE, g_LOG_LEVEL[logLevel], domain, tag, "%{public}s", buf); in DfxLog()
94 OHOS::HiviewDFX::HiLog::Debug(LOG_LABEL, "%{public}s", buf); in DfxLog()
97 OHOS::HiviewDFX::HiLog::Info(LOG_LABEL, "%{public}s", buf); in DfxLog()
100 OHOS::HiviewDFX::HiLog::Warn(LOG_LABEL, "%{public}s", buf); in DfxLog()
103 OHOS::HiviewDFX::HiLog::Error(LOG_LABEL, "%{public}s", buf); in DfxLog()
106 OHOS::HiviewDFX::HiLog::Fatal(LOG_LABEL, "%{public}s", buf); in DfxLog()
114 LogToDmesg(logLevel, tag, buf); in DfxLog()
117 fprintf(stderr, "%s\n", buf); in DfxLog()
/base/inputmethod/imf/interfaces/kits/js/napi/inputmethod_extension_context/
Dinputmethod_extension_context_module.cpp34 const char **buf, int *bufLen) in NAPI_InputMethodExtensionContext_GetJSCode() argument
36 if (buf != nullptr) { in NAPI_InputMethodExtensionContext_GetJSCode()
37 *buf = _binary_inputmethod_extension_context_js_start; in NAPI_InputMethodExtensionContext_GetJSCode()
46 const char **buf, int *buflen) in NAPI_InputMethodExtensionContext_GetABCCode() argument
48 if (buf != nullptr) { in NAPI_InputMethodExtensionContext_GetABCCode()
49 *buf = _binary_inputmethod_extension_context_abc_start; in NAPI_InputMethodExtensionContext_GetABCCode()
/base/theme/wallpaper_mgr/interfaces/kits/napi/wallpaper_extension_context/
Dwallpaper_extension_context_module.cpp36 void NAPI_WallpaperExtensionContext_GetJSCode(const char **buf, int *bufLen) in NAPI_WallpaperExtensionContext_GetJSCode() argument
38 if (buf != nullptr) { in NAPI_WallpaperExtensionContext_GetJSCode()
39 *buf = _binary_wallpaper_extension_context_js_start; in NAPI_WallpaperExtensionContext_GetJSCode()
49 void NAPI_WallpaperExtensionContext_GetABCCode(const char **buf, int *buflen) in NAPI_WallpaperExtensionContext_GetABCCode() argument
51 if (buf != nullptr) { in NAPI_WallpaperExtensionContext_GetABCCode()
52 *buf = _binary_wallpaper_extension_context_abc_start; in NAPI_WallpaperExtensionContext_GetABCCode()
/base/theme/wallpaper_mgr/interfaces/kits/napi/wallpaperextension/
Dwallpaper_extension_module.cpp36 void NAPI_WallpaperExtension_GetJSCode(const char **buf, int *bufLen) in NAPI_WallpaperExtension_GetJSCode() argument
38 if (buf != nullptr) { in NAPI_WallpaperExtension_GetJSCode()
39 *buf = _binary_wallpaper_extension_js_start; in NAPI_WallpaperExtension_GetJSCode()
49 void NAPI_WallpaperExtension_GetABCCode(const char **buf, int *buflen) in NAPI_WallpaperExtension_GetABCCode() argument
51 if (buf != nullptr) { in NAPI_WallpaperExtension_GetABCCode()
52 *buf = _binary_wallpaper_extension_abc_start; in NAPI_WallpaperExtension_GetABCCode()
/base/inputmethod/imf/interfaces/kits/js/napi/inputmethod_extension_ability/
Dinputmethod_extension_ability_module.cpp34 const char **buf, int *bufLen) in NAPI_InputMethodExtensionAbility_GetJSCode() argument
36 if (buf != nullptr) { in NAPI_InputMethodExtensionAbility_GetJSCode()
37 *buf = _binary_inputmethod_extension_ability_js_start; in NAPI_InputMethodExtensionAbility_GetJSCode()
46 const char **buf, int *buflen) in NAPI_InputMethodExtensionAbility_GetABCCode() argument
48 if (buf != nullptr) { in NAPI_InputMethodExtensionAbility_GetABCCode()
49 *buf = _binary_inputmethod_extension_ability_abc_start; in NAPI_InputMethodExtensionAbility_GetABCCode()
/base/customization/enterprise_device_management/interfaces/kits/enterprise_admin_extension/
Denterprise_admin_extension_ability_module.cpp35 const char **buf, int *bufLen) in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetJSCode() argument
37 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetJSCode()
38 *buf = _binary_enterprise_admin_extension_ability_js_start; in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetJSCode()
49 const char **buf, int *buflen) in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetABCCode() argument
51 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetABCCode()
52 *buf = _binary_enterprise_admin_extension_ability_abc_start; in NAPI_enterprise_EnterpriseAdminExtensionAbility_GetABCCode()
/base/customization/enterprise_device_management/interfaces/kits/enterprise_admin_extension_context/
Denterprise_admin_extension_context_module.cpp35 const char **buf, int *bufLen) in NAPI_enterprise_EnterpriseAdminExtensionContext_GetJSCode() argument
37 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionContext_GetJSCode()
38 *buf = _binary_enterprise_admin_extension_context_js_start; in NAPI_enterprise_EnterpriseAdminExtensionContext_GetJSCode()
49 const char **buf, int *buflen) in NAPI_enterprise_EnterpriseAdminExtensionContext_GetABCCode() argument
51 if (buf != nullptr) { in NAPI_enterprise_EnterpriseAdminExtensionContext_GetABCCode()
52 *buf = _binary_enterprise_admin_extension_context_abc_start; in NAPI_enterprise_EnterpriseAdminExtensionContext_GetABCCode()
/base/security/device_auth/deps_adapter/os_adapter/interfaces/linux/
Dhc_log.h51 #define DEV_AUTH_LOG_DEBUG(buf) HiLogPrint(LOG_CORE, LOG_DEBUG, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "… argument
52 #define DEV_AUTH_LOG_INFO(buf) HiLogPrint(LOG_CORE, LOG_INFO, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "%{… argument
53 #define DEV_AUTH_LOG_WARN(buf) HiLogPrint(LOG_CORE, LOG_WARN, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "%{… argument
54 #define DEV_AUTH_LOG_ERROR(buf) HiLogPrint(LOG_CORE, LOG_ERROR, DEV_AUTH_LOG_DOMAIN, "[DEVAUTH]", "… argument
/base/startup/appspawn/standard/
Dmain.c33 char buf[128] = APPSPAWN_PRELOAD; // 128 is enough in most cases in CheckPreload() local
35 int len = sprintf_s(buf, sizeof(buf), "%s:" APPSPAWN_PRELOAD, preload); in CheckPreload()
38 int ret = setenv("LD_PRELOAD", buf, true); in CheckPreload()
39 APPSPAWN_CHECK(ret == 0, return, "setenv fail: %{public}s", buf); in CheckPreload()
40 ssize_t nread = readlink("/proc/self/exe", buf, sizeof(buf) - 1); in CheckPreload()
42 buf[nread] = 0; in CheckPreload()
43 ret = execv(buf, argv); in CheckPreload()
44 APPSPAWN_LOGE("execv fail: %{public}s: %{public}d: %{public}d", buf, errno, ret); in CheckPreload()
/base/security/huks/test/unittest/huks_lite_test/common/
Dhks_test_log.c27 char buf[MAX_LOG_BUFF_LEN] = { 0 }; in HksTestLog() local
31 int32_t ret = vsnprintf_s(buf, MAX_LOG_BUFF_LEN, MAX_LOG_BUFF_LEN - 1, format, ap); in HksTestLog()
40 printf("[INFO] %s [%d]: %s\n", funcName, lineNo, buf); in HksTestLog()
43 printf("[ERROR] %s [%d]: %s\n", funcName, lineNo, buf); in HksTestLog()
46 printf("[WARNING] %s [%d]: %s\n", funcName, lineNo, buf); in HksTestLog()
49 printf("[DEBUG] %s [%d]: %s\n", funcName, lineNo, buf); in HksTestLog()
/base/security/device_auth/deps_adapter/os_adapter/impl/src/
Dhc_log.c21 static void DevAuthOutPrint(const char *buf, DevAuthLogLevel level) in DevAuthOutPrint() argument
24 printf("[DEVAUTH]: %s\n", buf); in DevAuthOutPrint()
29 DEV_AUTH_LOG_DEBUG(buf); in DevAuthOutPrint()
32 DEV_AUTH_LOG_INFO(buf); in DevAuthOutPrint()
35 DEV_AUTH_LOG_WARN(buf); in DevAuthOutPrint()
38 DEV_AUTH_LOG_ERROR(buf); in DevAuthOutPrint()
/base/theme/screenlock_mgr/interfaces/kits/napi/src/
Dscreenlock_js_util.cpp35 char *buf = new (std::nothrow) char[maxLen + 1]; in Convert2String() local
36 if (buf == nullptr) { in Convert2String()
40 status = napi_get_value_string_utf8(env, jsString, buf, maxLen + 1, &len); in Convert2String()
44 buf[len] = 0; in Convert2String()
45 std::string value(buf); in Convert2String()
46 delete[] buf; in Convert2String()

1234567891011