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

Go to the source code of this file.

Functions

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

Function Documentation

◆ strzero_s()

errno_t strzero_s ( char *  dest,
rsize_t  dmax 
)

Nulls dmax characters of dest.

This function can be used to clear strings that contained sensitive data.

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()

Definition at line 60 of file strzero_s.c.