safec  3.0
Safe C Library - ISO TR24731 Bounds Checking Interface
strzero_s.c File Reference
#include "safe_str_lib.h"
+ Include dependency graph for strzero_s.c:

Functions

EXPORT errno_t strzero_s (char *dest, rsize_t dmax)
 Nulls maximal dmax characters of dest. More...
 

Function Documentation

◆ strzero_s()

EXPORT errno_t strzero_s ( char *  dest,
rsize_t  dmax 
)

Nulls maximal dmax characters of dest.

This function can be used to clear strings that contained sensitive data, until the terminating NULL character. With SAFECLIB_STR_NULL_SLACK defined all elements following the terminating null character (if any) written in the array of dmax characters pointed to by dest are nulled.

Remarks
EXTENSION TO ISO/IEC TR 24731, Programming languages, environments and system software interfaces, Extensions to the C Library, Part I: Bounds-checking interfaces
Parameters
[out]destpointer to string that will be nulled.
[in]dmaxrestricted maximum length of dest
Return values
EOKwhen successful operation
ESNULLPwhen dest is NULL pointer
ESZEROLwhen dmax = 0
ESLEMAXwhen dmax > RSIZE_MAX_STR
See also
strispassword_s()