/third_party/bounds_checking_function/include/ |
H A D | securec.h | 129 * Parameter: destMax - The maximum length of destination buffer 134 SECUREC_API errno_t memset_s(void *dest, size_t destMax, int c, size_t count); 148 * Parameter: destMax - The maximum length of destination buffer 153 SECUREC_API errno_t memmove_s(void *dest, size_t destMax, const void *src, size_t count); 161 * Parameter: destMax - The maximum length of destination buffer 166 SECUREC_API errno_t memcpy_s(void *dest, size_t destMax, const void *src, size_t count); 174 * Parameter: destMax - The maximum length of destination buffer(including the terminating null character) 178 SECUREC_API errno_t strcpy_s(char *strDest, size_t destMax, const char *strSrc); 186 * Parameter: destMax - The maximum length of destination buffer(including the terminating null character) 191 SECUREC_API errno_t strncpy_s(char *strDest, size_t destMax, cons [all...] |
H A D | securectype.h | 487 #define SECUREC_STRNCPY_SM(dest, destMax, src, count) \ 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) \ 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), (sr [all...] |
/third_party/bounds_checking_function/src/ |
H A D | strncpy_s.c | 23 #define SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count) \ 24 (((destMax) > 0 && (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL && \ 27 #define SECUREC_STRNCPY_PARAM_OK(strDest, destMax, strSrc, count) \ 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 count) in CheckSrcCountRange() argument 37 size_t tmpDestMax = destMax; in CheckSrcCountRange() 41 /* Use destMax and count as boundary checker and destMax mus in CheckSrcCountRange() 58 strncpy_error(char *strDest, size_t destMax, const char *strSrc, size_t count) strncpy_error() argument 108 strncpy_s(char *strDest, size_t destMax, const char *strSrc, size_t count) strncpy_s() argument [all...] |
H A D | strncat_s.c | 20 SECUREC_INLINE errno_t SecDoCatLimit(char *strDest, size_t destMax, const char *strSrc, size_t count) 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() 62 * as destMax) and still leave room for a null terminator, then those characters 69 * destMax Size of the destination buffer. 78 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_STRING_MAX_LEN 80 * (strDest != NULL and strSrc is NULL and destMax ! 87 strncat_s(char *strDest, size_t destMax, const char *strSrc, size_t count) strncat_s() argument [all...] |
H A D | wcsncat_s.c | 20 SECUREC_INLINE errno_t SecDoCatLimitW(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size_t count) 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() 60 * given as destMax) and still leave room for a null terminator, then those 67 * destMax Size of the destination buffer. 76 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_WCHAR_STRING_MAX_LEN 78 * (strDest != NULL and strSrc is NULL and destMax ! 86 wcsncat_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size_t count) wcsncat_s() argument [all...] |
H A 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() 64 * destMax Size of the destination string buffer. 72 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_STRING_MAX_LEN 74 * (strDest != NULL and strSrc is NULL and destMax ! 81 strcat_s(char *strDest, size_t destMax, const char *strSrc) strcat_s() argument [all...] |
H A D | vsnprintf_s.c | 21 * except for the parameter destMax/count and the explicit runtime-constraints violation 28 * destMax The size of the strDest for output. 40 * return -1 if count < destMax and the output string has been truncated 42 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 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() 90 * except for the parameter destMax/coun 112 vsnprintf_truncated_s(char *strDest, size_t destMax, const char *format, va_list argList) vsnprintf_truncated_s() argument [all...] |
H A 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() 71 * destMax Size of the destination string buffer. 79 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_WCHAR_STRING_MAX_LEN 81 * (strDest != NULL and strSrc is NULL and destMax ! 89 wcscat_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc) wcscat_s() argument [all...] |
H A D | wcsncpy_s.c | 17 SECUREC_INLINE errno_t SecDoCpyLimitW(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size_t count) 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() 53 * destMax The size of the destination string, in characters. 62 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_WCHAR_STRING_MAX_LEN 63 * EINVAL_AND_RESET strDest != NULL and strSrc is NULL and destMax != 0 64 * and destMax <= SECUREC_WCHAR_STRING_MAX_LEN 65 * ERANGE destMax > SECUREC_WCHAR_STRING_MAX_LE 75 wcsncpy_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc, size_t count) wcsncpy_s() argument [all...] |
H A 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() 475 * The fread API in windows will call memcpy_s and pass 0xffffffff to destMax. 478 #define SECUREC_MEMCPY_PARAM_OK(dest, destMax, src, count) (SECUREC_LIKELY((count) <= (destMax) 515 memcpy_s(void *dest, size_t destMax, const void *src, size_t count) memcpy_s() argument 533 memcpy_sOptAsm(void *dest, size_t destMax, const void *src, size_t count) memcpy_sOptAsm() argument 544 memcpy_sOptTc(void *dest, size_t destMax, const void *src, size_t count) memcpy_sOptTc() argument [all...] |
H A D | strcpy_s.c | 26 #define SECUREC_STRCPY_PARAM_OK(strDest, destMax, strSrc) ((destMax) > 0 && \ 27 (destMax) <= SECUREC_STRING_MAX_LEN && (strDest) != NULL && (strSrc) != NULL && (strDest) != (strSrc)) 264 SECUREC_INLINE errno_t CheckSrcRange(char *strDest, size_t destMax, const char *strSrc) in CheckSrcRange() argument 266 size_t tmpDestMax = destMax; in CheckSrcRange() 268 /* Use destMax as boundary checker and destMax must be greater than zero */ 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_LE in strcpy_error() 327 strcpy_s(char *strDest, size_t destMax, const char *strSrc) strcpy_s() argument [all...] |
H A D | secureprintoutput.h | 120 #define SECUREC_VSPRINTF_PARAM_ERROR(format, strDest, destMax, maxLimit) \ 121 ((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) 123 #define SECUREC_VSPRINTF_CLEAR_DEST(strDest, destMax, maxLimit) do { \ 124 if ((strDest) != NULL && (destMax) > 0 && (destMax) <= (maxLimit)) { \ 130 #define SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, count, maxLimit) \ 131 (((format) == NULL || (strDest) == NULL || (destMax) == 0 || (destMax) > (maxLimit)) || \ 135 #define SECUREC_VSNPRINTF_PARAM_ERROR(format, strDest, destMax, coun [all...] |
H A 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() 49 * destMax Size of the destination string buffer. 57 * EINVAL strDest is NULL and destMax != 0 and destMax <= SECUREC_WCHAR_STRING_MAX_LEN 58 * EINVAL_AND_RESET strDest != NULL and strSrc is NULL and destMax != 0 59 * and destMax <= SECUREC_WCHAR_STRING_MAX_LEN 60 * ERANGE destMax > SECUREC_WCHAR_STRING_MAX_LEN or destMax i 70 wcscpy_s(wchar_t *strDest, size_t destMax, const wchar_t *strSrc) wcscpy_s() argument [all...] |
H A D | wmemmove_s.c | 29 * destMax Size of the destination buffer. 38 * EINVAL dest is NULL and destMax != 0 and count <= destMax 39 * and destMax <= SECUREC_WCHAR_MEM_MAX_LEN 40 * EINVAL_AND_RESET dest != NULL and src is NULL and destMax != 0 41 * and destMax <= SECUREC_WCHAR_MEM_MAX_LEN and count <= destMax 42 * ERANGE destMax > SECUREC_WCHAR_MEM_MAX_LEN or destMax is 0 or 43 * (count > destMax an 54 wmemmove_s(wchar_t *dest, size_t destMax, const wchar_t *src, size_t count) wmemmove_s() argument [all...] |
H A D | wmemcpy_s.c | 29 * destMax Size of the destination buffer. 38 * EINVAL dest is NULL and destMax != 0 and count <= destMax 39 * and destMax <= SECUREC_WCHAR_MEM_MAX_LEN 40 * EINVAL_AND_RESET dest != NULL and src is NULL and destMax != 0 41 * and destMax <= SECUREC_WCHAR_MEM_MAX_LEN and count <= destMax 42 * ERANGE destMax > SECUREC_WCHAR_MEM_MAX_LEN or destMax is 0 or 43 * (count > destMax an 55 wmemcpy_s(wchar_t *dest, size_t destMax, const wchar_t *src, size_t count) wmemcpy_s() argument [all...] |
H A D | memset_s.c | 22 #define SECUREC_MEMSET_PARAM_OK(dest, destMax, count) (SECUREC_LIKELY((destMax) <= SECUREC_MEM_MAX_LEN && \ 23 (dest) != NULL && (count) <= (destMax))) 431 SECUREC_INLINE errno_t SecMemsetError(void *dest, size_t destMax, int c) in SecMemsetError() argument 433 /* Check destMax is 0 compatible with _sp macro */ in SecMemsetError() 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() 454 * destMax The size of the buffer. 463 * EINVAL dest == NULL and destMax ! 469 memset_s(void *dest, size_t destMax, int c, size_t count) memset_s() argument 487 memset_sOptAsm(void *dest, size_t destMax, int c, size_t count) memset_sOptAsm() argument 500 memset_sOptTc(void *dest, size_t destMax, int c, size_t count) memset_sOptTc() argument [all...] |
H A D | memmove_s.c | 66 * destMax Size of the destination buffer. 75 * EINVAL dest is NULL and destMax != 0 and destMax <= SECUREC_MEM_MAX_LEN 76 * EINVAL_AND_RESET dest != NULL and src is NULL and destMax != 0 and destMax <= SECUREC_MEM_MAX_LEN 77 * ERANGE destMax > SECUREC_MEM_MAX_LEN or destMax is 0 78 * ERANGE_AND_RESET count > destMax and dest != NULL and src != NULL and destMax != 0 79 * and destMax < 86 memmove_s(void *dest, size_t destMax, const void *src, size_t count) memmove_s() argument [all...] |
H A D | vsprintf_s.c | 20 * except for the parameter destMax and the explicit runtime-constraints violation 28 * destMax Size of strDest 39 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 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()
|
H A D | vswprintf_s.c | 27 * destMax Maximum number of characters to store 38 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 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()
|
H A D | snprintf_s.c | 21 * except for the parameter destMax/count and the explicit runtime-constraints violation 30 * destMax The size of the storage location for output. Size 42 * return -1 if count < destMax and the output string has been truncated 44 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 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() 68 * except for the parameter destMax/count and the explicit runtime-constraints violation 77 * destMax The size of the storage location for output. Size 88 * return destMax-1 if output string has been truncated 90 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax vali 93 snprintf_truncated_s(char *strDest, size_t destMax, const char *format, ...) snprintf_truncated_s() argument [all...] |
H A D | gets_s.c | 33 * specified by destMax from the std input stream, into the array pointed to by buffer 42 * destMax The size of the buffer. 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()
|
H A D | sprintf_s.c | 20 * except for the parameter destMax and the explicit runtime-constraints violation 30 * destMax Maximum number of characters to store. 41 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 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()
|
H A D | swprintf_s.c | 23 * destMax Maximum number of characters to store. 34 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 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()
|
/third_party/musl/src/hilog/linux/ |
H A D | vsnprintf_s_p.c | 195 * except for the parameter destMax/count and the explicit runtime-constraints violation 202 * destMax The size of the strDest for output. 215 * return -1 if count < destMax and the output string has been truncated 217 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 221 int vsnprintfp_s(char *strDest, size_t destMax, size_t count, int priv, const char *format, va_list arglist) 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() 240 } else { /* destMax < in vsnprintfp_s() [all...] |
/third_party/musl/porting/linux/user/src/hilog/ |
H A D | vsnprintf_s_p.c | 195 * except for the parameter destMax/count and the explicit runtime-constraints violation 202 * destMax The size of the strDest for output. 215 * return -1 if count < destMax and the output string has been truncated 217 * If there is a runtime-constraint violation, strDest[0] will be set to the '\0' when strDest and destMax valid 221 int vsnprintfp_s(char *strDest, size_t destMax, size_t count, int priv, const char *format, va_list arglist) 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() 240 } else { /* destMax < in vsnprintfp_s() [all...] |