/third_party/bounds_checking_function/include/ |
D | securec.h | 134 SECUREC_API errno_t memset_s(void *dest, size_t destMax, int c, size_t count); 153 SECUREC_API errno_t memmove_s(void *dest, size_t destMax, const void *src, size_t count); 166 SECUREC_API errno_t memcpy_s(void *dest, size_t destMax, const void *src, size_t count); 178 SECUREC_API errno_t strcpy_s(char *strDest, size_t destMax, const char *strSrc); 191 SECUREC_API errno_t strncpy_s(char *strDest, size_t destMax, const char *strSrc, size_t count); 203 SECUREC_API errno_t strcat_s(char *strDest, size_t destMax, const char *strSrc); 217 SECUREC_API errno_t strncat_s(char *strDest, size_t destMax, const char *strSrc, size_t count); 231 SECUREC_API int vsprintf_s(char *strDest, size_t destMax, const char *format, 245 SECUREC_API int sprintf_s(char *strDest, size_t destMax, const char *format, ...) SECUREC_ATTRIBUTE… 260 SECUREC_API int vsnprintf_s(char *strDest, size_t destMax, size_t count, const char *format, [all …]
|
D | securectype.h | 487 #define SECUREC_STRNCPY_SM(dest, destMax, src, count) \ argument 488 (((void *)(dest) != NULL && (const void *)(src) != NULL && (size_t)(destMax) > 0 && \ 489 (((unsigned long long)(destMax) & (unsigned long long)(-2)) < SECUREC_STRING_MAX_LEN) && \ 490 (SECUREC_TWO_MIN((size_t)(count), strlen(src)) + 1) <= (size_t)(destMax)) ? \ 492 …(memcpy((dest), (src), strlen(src) + 1), EOK)) : (strncpy_error((dest), (destMax), (src), (count))… 494 #define SECUREC_STRCPY_SM(dest, destMax, src) \ argument 495 (((void *)(dest) != NULL && (const void *)(src) != NULL && (size_t)(destMax) > 0 && \ 496 (((unsigned long long)(destMax) & (unsigned long long)(-2)) < SECUREC_STRING_MAX_LEN) && \ 497 (strlen(src) + 1) <= (size_t)(destMax)) ? (memcpy((dest), (src), strlen(src) + 1), EOK) : \ 498 (strcpy_error((dest), (destMax), (src)))) [all …]
|
/third_party/bounds_checking_function/src/ |
D | strncpy_s.c | 23 #define SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count) \ argument 24 …(((destMax) > 0 && (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL &&… 27 #define SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count) \ argument 28 …(((destMax) > 0 && (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL &&… 35 SECUREC_INLINE errno_t CheckSrcCountRange(char *strDest, size_t destMax, const char *strSrc, size_t… in CheckSrcCountRange() argument 37 size_t tmpDestMax = destMax; in CheckSrcCountRange() 58 errno_t strncpy_error(char *strDest, size_t destMax, const char *strSrc, size_t count) in strncpy_error() argument 60 if (destMax == 0 || destMax > SECUREC_STRING_MAX_LEN) { in strncpy_error() 81 return CheckSrcCountRange(strDest, destMax, strSrc, count); in strncpy_error() 108 errno_t strncpy_s(char *strDest, size_t destMax, const char *strSrc, size_t count) in strncpy_s() argument [all …]
|
D | strncat_s.c | 20 SECUREC_INLINE errno_t SecDoCatLimit(char *strDest, size_t destMax, const char *strSrc, size_t coun… in SecDoCatLimit() argument 24 SECUREC_CALC_STR_LEN(strDest, destMax, &destLen); in SecDoCatLimit() 33 if (strDest + destLen <= strSrc && destLen == destMax) { in SecDoCatLimit() 40 if (srcLen + destLen >= destMax || strDest == strSrc) { in SecDoCatLimit() 42 if (destLen == destMax) { in SecDoCatLimit() 87 errno_t strncat_s(char *strDest, size_t destMax, const char *strSrc, size_t count) in strncat_s() argument 89 if (destMax == 0 || destMax > SECUREC_STRING_MAX_LEN) { in strncat_s() 106 return SecDoCatLimit(strDest, destMax, strSrc, destMax); in strncat_s() 113 return SecDoCatLimit(strDest, destMax, strSrc, count); in strncat_s()
|
D | wcsncat_s.c | 20 SECUREC_INLINE errno_t SecDoCatLimitW(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size… in SecDoCatLimitW() argument 25 SECUREC_CALC_WSTR_LEN(strDest, destMax, &destLen); in SecDoCatLimitW() 30 if (strDest + destLen <= strSrc && destLen == destMax) { in SecDoCatLimitW() 37 if (srcLen + destLen >= destMax || strDest == strSrc) { in SecDoCatLimitW() 39 if (destLen == destMax) { in SecDoCatLimitW() 86 errno_t wcsncat_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size_t count) in wcsncat_s() argument 88 if (destMax == 0 || destMax > SECUREC_WCHAR_STRING_MAX_LEN) { in wcsncat_s() 104 return SecDoCatLimitW(strDest, destMax, strSrc, destMax); in wcsncat_s() 111 return SecDoCatLimitW(strDest, destMax, strSrc, count); in wcsncat_s()
|
D | memcpy_s.c | 445 SECUREC_INLINE errno_t SecMemcpyError(void *dest, size_t destMax, const void *src, size_t count) in SecMemcpyError() argument 447 if (destMax == 0 || destMax > SECUREC_MEM_MAX_LEN) { in SecMemcpyError() 454 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax); in SecMemcpyError() 459 if (count > destMax) { in SecMemcpyError() 460 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax); in SecMemcpyError() 465 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax); in SecMemcpyError() 478 #define SECUREC_MEMCPY_PARAM_OK(dest, destMax, src, count) (SECUREC_LIKELY((count) <= (destMax) && \ argument 482 #define SECUREC_MEMCPY_PARAM_OK(dest, destMax, src, count) (SECUREC_LIKELY((count) <= (destMax) && \ argument 483 (dest) != NULL && (src) != NULL && (destMax) <= SECUREC_MEM_MAX_LEN && \ 515 errno_t memcpy_s(void *dest, size_t destMax, const void *src, size_t count) in memcpy_s() argument [all …]
|
D | secureprintoutput.h | 120 #define SECUREC_VSPRINTF_PARAM_ERROR(format, strDest, destMax, maxLimit) \ argument 121 ((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) 123 #define SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, maxLimit) do { \ argument 124 if ((strDest) != NULL && (destMax) > 0 && (destMax) <= (maxLimit)) { \ 130 #define SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, count, maxLimit) \ argument 131 (((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) || \ 135 #define SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, count, maxLimit) \ argument 136 (((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) || \
|
D | strcat_s.c | 20 SECUREC_INLINE errno_t SecDoCat(char *strDest, size_t destMax, const char *strSrc) in SecDoCat() argument 25 SECUREC_CALC_STR_LEN(strDest, destMax, &destLen); in SecDoCat() 27 maxSrcLen = destMax - destLen; in SecDoCat() 32 if (strDest + destLen <= strSrc && destLen == destMax) { in SecDoCat() 39 if (srcLen + destLen >= destMax || strDest == strSrc) { in SecDoCat() 41 if (destLen == destMax) { in SecDoCat() 81 errno_t strcat_s(char *strDest, size_t destMax, const char *strSrc) in strcat_s() argument 83 if (destMax == 0 || destMax > SECUREC_STRING_MAX_LEN) { in strcat_s() 95 return SecDoCat(strDest, destMax, strSrc); in strcat_s()
|
D | wcscat_s.c | 20 SECUREC_INLINE errno_t SecDoCatW(wchar_t *strDest, size_t destMax, const wchar_t *strSrc) in SecDoCatW() argument 27 SECUREC_CALC_WSTR_LEN(strDest, destMax, &destLen); in SecDoCatW() 28 maxCount = destMax - destLen; in SecDoCatW() 33 if (strDest + destLen <= strSrc && destLen == destMax) { in SecDoCatW() 40 if (srcLen + destLen >= destMax || strDest == strSrc) { in SecDoCatW() 42 if (destLen == destMax) { in SecDoCatW() 89 errno_t wcscat_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc) in wcscat_s() argument 91 if (destMax == 0 || destMax > SECUREC_WCHAR_STRING_MAX_LEN) { in wcscat_s() 105 return SecDoCatW(strDest, destMax, strSrc); in wcscat_s()
|
D | vsnprintf_s.c | 44 int vsnprintf_s(char *strDest, size_t destMax, size_t count, const char *format, va_list argList) in vsnprintf_s() argument 48 if (SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, count, SECUREC_STRING_MAX_LEN)) { in vsnprintf_s() 49 SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, SECUREC_STRING_MAX_LEN); in vsnprintf_s() 54 if (destMax > count) { in vsnprintf_s() 61 retVal = SecVsnprintfImpl(strDest, destMax, format, argList); in vsnprintf_s() 112 int vsnprintf_truncated_s(char *strDest, size_t destMax, const char *format, va_list argList) in vsnprintf_truncated_s() argument 116 if (SECUREC_VSPRINTF_PARAM_ERROR(format, strDest, destMax, SECUREC_STRING_MAX_LEN)) { in vsnprintf_truncated_s() 117 SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, SECUREC_STRING_MAX_LEN); in vsnprintf_truncated_s() 122 retVal = SecVsnprintfImpl(strDest, destMax, format, argList); in vsnprintf_truncated_s() 125 return (int)(destMax - 1); /* To skip error handler, return strlen(strDest) */ in vsnprintf_truncated_s()
|
D | wcsncpy_s.c | 17 SECUREC_INLINE errno_t SecDoCpyLimitW(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size… in SecDoCpyLimitW() argument 20 if (count < destMax) { in SecDoCpyLimitW() 23 SECUREC_CALC_WSTR_LEN(strSrc, destMax, &srcStrLen); in SecDoCpyLimitW() 25 if (srcStrLen == destMax) { in SecDoCpyLimitW() 75 errno_t wcsncpy_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size_t count) in wcsncpy_s() argument 77 if (destMax == 0 || destMax > SECUREC_WCHAR_STRING_MAX_LEN) { in wcsncpy_s() 92 return SecDoCpyLimitW(strDest, destMax, strSrc, destMax - 1); in wcsncpy_s() 105 return SecDoCpyLimitW(strDest, destMax, strSrc, count); in wcsncpy_s()
|
D | strcpy_s.c | 26 #define SECUREC_STRCPY_PARAM_OK(strDest, destMax, strSrc) ((destMax) > 0 && \ argument 27 …(destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL && (strDest) != (strS… 264 SECUREC_INLINE errno_t CheckSrcRange(char *strDest, size_t destMax, const char *strSrc) in CheckSrcRange() argument 266 size_t tmpDestMax = destMax; in CheckSrcRange() 284 errno_t strcpy_error(char *strDest, size_t destMax, const char *strSrc) in strcpy_error() argument 286 if (destMax == 0 || destMax > SECUREC_STRING_MAX_LEN) { in strcpy_error() 298 return CheckSrcRange(strDest, destMax, strSrc); in strcpy_error() 327 errno_t strcpy_s(char *strDest, size_t destMax, const char *strSrc) in strcpy_s() argument 329 if (SECUREC_STRCPY_PARAM_OK(strDest, destMax, strSrc)) { in strcpy_s() 331 SECUREC_CALC_STR_LEN(strSrc, destMax, &srcStrLen); in strcpy_s() [all …]
|
D | memset_s.c | 22 #define SECUREC_MEMSET_PARAM_OK(dest, destMax, count) (SECUREC_LIKELY((destMax) <= SECUREC_MEM_MAX_… argument 23 (dest) != NULL && (count) <= (destMax))) 431 SECUREC_INLINE errno_t SecMemsetError(void *dest, size_t destMax, int c) in SecMemsetError() argument 434 if (destMax == 0 || destMax > SECUREC_MEM_MAX_LEN) { in SecMemsetError() 442 SECUREC_MEMSET_PREVENT_DSE(dest, c, destMax); /* Set entire buffer to value c */ in SecMemsetError() 469 errno_t memset_s(void *dest, size_t destMax, int c, size_t count) in memset_s() argument 471 if (SECUREC_MEMSET_PARAM_OK(dest, destMax, count)) { in memset_s() 476 return SecMemsetError(dest, destMax, c); in memset_s() 487 errno_t memset_sOptAsm(void *dest, size_t destMax, int c, size_t count) in memset_sOptAsm() argument 489 if (SECUREC_MEMSET_PARAM_OK(dest, destMax, count)) { in memset_sOptAsm() [all …]
|
D | wcscpy_s.c | 17 SECUREC_INLINE errno_t SecDoCpyW(wchar_t *strDest, size_t destMax, const wchar_t *strSrc) in SecDoCpyW() argument 20 SECUREC_CALC_WSTR_LEN(strSrc, destMax, &srcStrLen); in SecDoCpyW() 22 if (srcStrLen == destMax) { in SecDoCpyW() 70 errno_t wcscpy_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc) in wcscpy_s() argument 72 if (destMax == 0 || destMax > SECUREC_WCHAR_STRING_MAX_LEN) { in wcscpy_s() 84 return SecDoCpyW(strDest, destMax, strSrc); in wcscpy_s()
|
D | wmemcpy_s.c | 55 errno_t wmemcpy_s(wchar_t *dest, size_t destMax, const wchar_t *src, size_t count) in wmemcpy_s() argument 57 if (destMax == 0 || destMax > SECUREC_WCHAR_MEM_MAX_LEN) { in wmemcpy_s() 61 if (count > destMax) { in wmemcpy_s() 64 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax * sizeof(wchar_t)); in wmemcpy_s() 69 return memcpy_s(dest, destMax * sizeof(wchar_t), src, count * sizeof(wchar_t)); in wmemcpy_s()
|
D | wmemmove_s.c | 54 errno_t wmemmove_s(wchar_t *dest, size_t destMax, const wchar_t *src, size_t count) in wmemmove_s() argument 56 if (destMax == 0 || destMax > SECUREC_WCHAR_MEM_MAX_LEN) { in wmemmove_s() 60 if (count > destMax) { in wmemmove_s() 63 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax * sizeof(wchar_t)); in wmemmove_s() 68 return memmove_s(dest, destMax * sizeof(wchar_t), src, count * sizeof(wchar_t)); in wmemmove_s()
|
D | memmove_s.c | 86 errno_t memmove_s(void *dest, size_t destMax, const void *src, size_t count) in memmove_s() argument 88 if (destMax == 0 || destMax > SECUREC_MEM_MAX_LEN) { in memmove_s() 95 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax); in memmove_s() 100 if (count > destMax) { in memmove_s() 101 (void)SECUREC_MEMSET_FUNC_OPT(dest, 0, destMax); in memmove_s()
|
D | vsprintf_s.c | 41 int vsprintf_s(char *strDest, size_t destMax, const char *format, va_list argList) in vsprintf_s() argument 45 if (SECUREC_VSPRINTF_PARAM_ERROR(format, strDest, destMax, SECUREC_STRING_MAX_LEN)) { in vsprintf_s() 46 SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, SECUREC_STRING_MAX_LEN); in vsprintf_s() 51 retVal = SecVsnprintfImpl(strDest, destMax, format, argList); in vsprintf_s()
|
D | vswprintf_s.c | 40 int vswprintf_s(wchar_t *strDest, size_t destMax, const wchar_t *format, va_list argList) in vswprintf_s() argument 43 if (SECUREC_VSPRINTF_PARAM_ERROR(format, strDest, destMax, SECUREC_WCHAR_STRING_MAX_LEN)) { in vswprintf_s() 44 SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, SECUREC_WCHAR_STRING_MAX_LEN); in vswprintf_s() 49 retVal = SecVswprintfImpl(strDest, destMax, format, argList); in vswprintf_s()
|
D | gets_s.c | 51 char *gets_s(char *buffer, size_t destMax) in gets_s() argument 54 size_t bufferSize = ((destMax == (size_t)(-1)) ? SECUREC_STRING_MAX_LEN : destMax); in gets_s() 56 size_t bufferSize = destMax; in gets_s()
|
D | snprintf_s.c | 47 int snprintf_s(char *strDest, size_t destMax, size_t count, const char *format, ...) in snprintf_s() argument 53 ret = vsnprintf_s(strDest, destMax, count, format, argList); in snprintf_s() 93 int snprintf_truncated_s(char *strDest, size_t destMax, const char *format, ...) in snprintf_truncated_s() argument 99 ret = vsnprintf_truncated_s(strDest, destMax, format, argList); in snprintf_truncated_s()
|
D | swprintf_s.c | 36 int swprintf_s(wchar_t *strDest, size_t destMax, const wchar_t *format, ...) in swprintf_s() argument 42 ret = vswprintf_s(strDest, destMax, format, argList); in swprintf_s()
|
D | sprintf_s.c | 43 int sprintf_s(char *strDest, size_t destMax, const char *format, ...) in sprintf_s() argument 49 ret = vsprintf_s(strDest, destMax, format, argList); in sprintf_s()
|
/third_party/musl/porting/linux/user/src/hilog/ |
D | vsnprintf_s_p.c | 221 int vsnprintfp_s(char *strDest, size_t destMax, size_t count, int priv, const char *format, va_lis… in vsnprintfp_s() argument 225 if (format == NULL || strDest == NULL || destMax == 0 || destMax > SECUREC_STRING_MAX_LEN || in vsnprintfp_s() 227 if (strDest != NULL && destMax > 0) { in vsnprintfp_s() 234 if (destMax > count) { in vsnprintfp_s() 241 retVal = SecVsnprintfPImpl(strDest, destMax, priv, format, arglist); in vsnprintfp_s()
|
/third_party/musl/src/hilog/linux/ |
D | vsnprintf_s_p.c | 221 int vsnprintfp_s(char *strDest, size_t destMax, size_t count, int priv, const char *format, va_lis… in vsnprintfp_s() argument 225 if (format == NULL || strDest == NULL || destMax == 0 || destMax > SECUREC_STRING_MAX_LEN || in vsnprintfp_s() 227 if (strDest != NULL && destMax > 0) { in vsnprintfp_s() 234 if (destMax > count) { in vsnprintfp_s() 241 retVal = SecVsnprintfPImpl(strDest, destMax, priv, format, arglist); in vsnprintfp_s()
|