Bump safeclib version
Signed-off-by: Jan Musial <jan.musial@intel.com>
This commit is contained in:
parent
5fa04ff1f1
commit
a4c82c364f
@ -1738,9 +1738,9 @@ int check_if_mounted(int cache_id, int core_id)
|
||||
}
|
||||
|
||||
while ((mstruct = getmntent(mtab)) != NULL) {
|
||||
error = strncmp_s(mstruct->mnt_fsname, PATH_MAX, dev_buf, sizeof(dev_buf), &difference);
|
||||
error = strcmp_s(mstruct->mnt_fsname, PATH_MAX, dev_buf, &difference);
|
||||
/* mstruct->mnt_fsname is /dev/... block device path, not a mountpoint */
|
||||
if (error)
|
||||
if (error != EOK)
|
||||
return FAILURE;
|
||||
if (!difference) {
|
||||
if (core_id<0) {
|
||||
|
@ -81,10 +81,6 @@ extern errno_t
|
||||
strcmp_s(const char *dest, rsize_t dmax,
|
||||
const char *src, int *indicator);
|
||||
|
||||
/* string compare */
|
||||
extern errno_t
|
||||
strncmp_s (const char *dest, rsize_t dmax,
|
||||
const char *src, rsize_t slen, int *indicator);
|
||||
|
||||
/* fixed field string compare */
|
||||
extern errno_t
|
||||
|
@ -137,75 +137,4 @@ strcmp_s (const char *dest, rsize_t dmax,
|
||||
*indicator = *dest - *src;
|
||||
return RCNEGATE(EOK);
|
||||
}
|
||||
EXPORT_SYMBOL(strcmp_s);
|
||||
|
||||
/**
|
||||
* NAME
|
||||
* strncmp_s
|
||||
*
|
||||
* Synpsos
|
||||
* #include "safe_str_lib.h"
|
||||
* errno_t
|
||||
* strncmp_s(const char *dest, rsize_t dmax,
|
||||
* const char *src, rsize_t slen, int *indicator)
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Compares string src to string dest.
|
||||
*
|
||||
* INPUT PARAMETERS
|
||||
* dest pointer to string to compare against
|
||||
*
|
||||
* dmax restricted maximum length of string dest
|
||||
*
|
||||
* src pointer to the string to be compared to dest
|
||||
*
|
||||
* slen restricted maximum length of string src
|
||||
*
|
||||
* indicator pointer to result indicator, greater than,
|
||||
* equal to or less than 0, if the string pointed
|
||||
* to by dest is greater than, equal to or less
|
||||
* than the string pointed to by src respectively.
|
||||
*
|
||||
* OUTPUT PARAMETERS
|
||||
* indicator updated result indicator
|
||||
*
|
||||
* RUNTIME CONSTRAINTS
|
||||
* Neither dest nor src shall be a null pointer.
|
||||
* indicator shall not be a null pointer.
|
||||
* neither dmax nor slen shall be 0
|
||||
* neither dmax nor slen shall be greater than RSIZE_MAX_STR
|
||||
*
|
||||
* RETURN VALUE
|
||||
* indicator, when the return code is OK
|
||||
* >0 dest greater than src
|
||||
* 0 strings the same
|
||||
* <0 dest less than src
|
||||
*
|
||||
* EOK
|
||||
* ESNULLP pointer was null
|
||||
* ESZEROL length was zero
|
||||
* ESLEMAX length exceeded max
|
||||
*
|
||||
* ALSO SEE
|
||||
* strcmp_s()
|
||||
*
|
||||
*/
|
||||
errno_t
|
||||
strncmp_s (const char *dest, rsize_t dmax,
|
||||
const char *src, rsize_t slen, int *indicator)
|
||||
{
|
||||
if (slen == 0) {
|
||||
invoke_safe_str_constraint_handler("strncmp_s: slen is 0",
|
||||
NULL, ESZEROL);
|
||||
return RCNEGATE(ESZEROL);
|
||||
}
|
||||
|
||||
if (slen > RSIZE_MAX_STR) {
|
||||
invoke_safe_str_constraint_handler("strncmp_s: slen exceeds max",
|
||||
NULL, ESLEMAX);
|
||||
return RCNEGATE(ESLEMAX);
|
||||
}
|
||||
|
||||
return strcmp_s(dest, dmax, src, indicator);
|
||||
}
|
||||
EXPORT_SYMBOL(strncmp_s);
|
||||
EXPORT_SYMBOL(strcmp_s)
|
||||
|
Loading…
Reference in New Issue
Block a user