Update SeCoE Safe String Library

Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
Jan Musial
2020-01-21 10:30:29 +01:00
parent 80d71fabea
commit 7e2b2877c8
16 changed files with 410 additions and 30 deletions

View File

@@ -61,4 +61,18 @@ static inline void handle_error(char *orig_dest, rsize_t orig_dmax,
return;
}
static inline void handle_wc_error(wchar_t *orig_dest, rsize_t orig_dmax,
char *err_msg, errno_t err_code)
{
#ifdef SAFECLIB_STR_NULL_SLACK
/* null string to eliminate partial copy */
while (orig_dmax) { *orig_dest = L'\0'; orig_dmax--; orig_dest++; }
#else
*orig_dest = L'\0';
#endif
invoke_safe_str_constraint_handler(err_msg, NULL, err_code);
return;
}
#endif /* __SAFE_STR_CONSTRAINT_H__ */