Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/ima-evm-utils-1.1/src/evmctl.c Examining data/ima-evm-utils-1.1/src/imaevm.h Examining data/ima-evm-utils-1.1/src/libimaevm.c FINAL RESULTS: data/ima-evm-utils-1.1/src/libimaevm.c:252:8: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. err = readlink(path, buf, sizeof(buf)); data/ima-evm-utils-1.1/src/evmctl.c:147:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s.%s", file, ext); data/ima-evm-utils-1.1/src/evmctl.c:149:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s", file); data/ima-evm-utils-1.1/src/evmctl.c:171:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s.%s", file, ext); data/ima-evm-utils-1.1/src/evmctl.c:173:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name, "%s", file); data/ima-evm-utils-1.1/src/evmctl.c:299:7: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen(path, "r"); data/ima-evm-utils-1.1/src/evmctl.c:385:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(xattr_value, selinux_str); data/ima-evm-utils-1.1/src/evmctl.c:393:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(xattr_value, caps_str); data/ima-evm-utils-1.1/src/imaevm.h:53:69: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define do_log(level, fmt, args...) ({ if (level <= params.verbose) fprintf(stderr, fmt, ##args); }) data/ima-evm-utils-1.1/src/imaevm.h:56:37: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. #define do_log(level, fmt, args...) syslog(level, fmt, ##args) data/ima-evm-utils-1.1/src/evmctl.c:1742:7: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. c = getopt_long(argc, argv, "hvnsda:op::fu::k:t:ri", opts, &lind); data/ima-evm-utils-1.1/src/evmctl.c:143:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[strlen(file) + (ext ? strlen(ext) : 0) + 2]; data/ima-evm-utils-1.1/src/evmctl.c:153:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(name, "w"); data/ima-evm-utils-1.1/src/evmctl.c:168:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[strlen(file) + (ext ? strlen(ext) : 0) + 2]; data/ima-evm-utils-1.1/src/evmctl.c:178:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(name, "r"); data/ima-evm-utils-1.1/src/evmctl.c:241:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char asciihex[2]; data/ima-evm-utils-1.1/src/evmctl.c:285:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX], _uuid[37]; data/ima-evm-utils-1.1/src/evmctl.c:297:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(path, "blkid -s UUID -o value /dev/block/%u:%u", major, minor); data/ima-evm-utils-1.1/src/evmctl.c:322:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char xattr_value[1024]; data/ima-evm-utils-1.1/src/evmctl.c:323:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char list[1024]; data/ima-evm-utils-1.1/src/evmctl.c:325:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uuid[16]; data/ima-evm-utils-1.1/src/evmctl.c:355:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(file, 0); data/ima-evm-utils-1.1/src/evmctl.c:493:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[20]; data/ima-evm-utils-1.1/src/evmctl.c:494:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sig[1024]; data/ima-evm-utils-1.1/src/evmctl.c:531:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[66]; /* MAX hash size + 2 */ data/ima-evm-utils-1.1/src/evmctl.c:569:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[64]; data/ima-evm-utils-1.1/src/evmctl.c:570:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sig[1024]; data/ima-evm-utils-1.1/src/evmctl.c:683:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[64]; data/ima-evm-utils-1.1/src/evmctl.c:684:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sig[1024] = "\x03"; data/ima-evm-utils-1.1/src/evmctl.c:749:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[20]; data/ima-evm-utils-1.1/src/evmctl.c:750:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sig[1024]; data/ima-evm-utils-1.1/src/evmctl.c:790:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sig[1024]; data/ima-evm-utils-1.1/src/evmctl.c:796:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sig, tmp, len); data/ima-evm-utils-1.1/src/evmctl.c:830:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char _pub[1024], *pub = _pub; data/ima-evm-utils-1.1/src/evmctl.c:832:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[20]; data/ima-evm-utils-1.1/src/evmctl.c:861:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char _pub[1024], *pub = _pub; data/ima-evm-utils-1.1/src/evmctl.c:863:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[20]; data/ima-evm-utils-1.1/src/evmctl.c:976:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char xattr_value[1024]; data/ima-evm-utils-1.1/src/evmctl.c:979:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char evmkey[MAX_KEY_SIZE]; data/ima-evm-utils-1.1/src/evmctl.c:980:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char list[1024]; data/ima-evm-utils-1.1/src/evmctl.c:1003:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(evmkey, key, keylen); data/ima-evm-utils-1.1/src/evmctl.c:1014:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(file, 0); data/ima-evm-utils-1.1/src/evmctl.c:1117:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[20]; data/ima-evm-utils-1.1/src/evmctl.c:1118:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sig[1024]; data/ima-evm-utils-1.1/src/evmctl.c:1127:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sig + 1, hash, len); data/ima-evm-utils-1.1/src/evmctl.c:1172:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024], *list = buf; data/ima-evm-utils-1.1/src/evmctl.c:1196:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(path, O_RDONLY); data/ima-evm-utils-1.1/src/evmctl.c:1283:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char *p, pcr_str[7], buf[70]; /* length of the TPM string */ data/ima-evm-utils-1.1/src/evmctl.c:1286:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(pcr_str, "PCR-%d", idx); data/ima-evm-utils-1.1/src/evmctl.c:1288:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(pcrs, "r"); data/ima-evm-utils-1.1/src/evmctl.c:1290:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(misc_pcrs, "r"); data/ima-evm-utils-1.1/src/evmctl.c:1319:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[TCG_EVENT_NAME_LEN_MAX + 1]; data/ima-evm-utils-1.1/src/evmctl.c:1463:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(file, "rb"); data/ima-evm-utils-1.1/src/imaevm.h:139:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mpi[0]; data/ima-evm-utils-1.1/src/imaevm.h:149:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mpi[0]; data/ima-evm-utils-1.1/src/libimaevm.c:60:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *const pkey_hash_algo[PKEY_HASH__LAST] = { data/ima-evm-utils-1.1/src/libimaevm.c:175:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(file, "r"); data/ima-evm-utils-1.1/src/libimaevm.c:250:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/ima-evm-utils-1.1/src/libimaevm.c:341:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(keyfile, "r"); data/ima-evm-utils-1.1/src/libimaevm.c:380:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char out[1024]; data/ima-evm-utils-1.1/src/libimaevm.c:382:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sighash[20]; data/ima-evm-utils-1.1/src/libimaevm.c:419:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[9]; data/ima-evm-utils-1.1/src/libimaevm.c:464:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(entry->name, "%x", __be32_to_cpup(&entry->keyid)); data/ima-evm-utils-1.1/src/libimaevm.c:475:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char out[1024]; data/ima-evm-utils-1.1/src/libimaevm.c:593:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[64]; data/ima-evm-utils-1.1/src/libimaevm.c:672:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(keyid, sha1 + 12, 8); data/ima-evm-utils-1.1/src/libimaevm.c:678:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%llX", (unsigned long long)id); data/ima-evm-utils-1.1/src/libimaevm.c:694:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(keyid, sha1 + 16, 4); data/ima-evm-utils-1.1/src/libimaevm.c:699:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(str, "%x", __be32_to_cpup(keyid)); data/ima-evm-utils-1.1/src/libimaevm.c:711:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(keyfile, "r"); data/ima-evm-utils-1.1/src/libimaevm.c:719:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[256]; data/ima-evm-utils-1.1/src/libimaevm.c:744:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char pub[1024]; data/ima-evm-utils-1.1/src/libimaevm.c:746:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[20]; data/ima-evm-utils-1.1/src/libimaevm.c:747:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sighash[20]; data/ima-evm-utils-1.1/src/libimaevm.c:825:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[20]; data/ima-evm-utils-1.1/src/libimaevm.c:869:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, asn1->data, asn1->size); data/ima-evm-utils-1.1/src/libimaevm.c:870:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + asn1->size, hash, size); data/ima-evm-utils-1.1/src/evmctl.c:143:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char name[strlen(file) + (ext ? strlen(ext) : 0) + 2]; data/ima-evm-utils-1.1/src/evmctl.c:143:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char name[strlen(file) + (ext ? strlen(ext) : 0) + 2]; data/ima-evm-utils-1.1/src/evmctl.c:168:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char name[strlen(file) + (ext ? strlen(ext) : 0) + 2]; data/ima-evm-utils-1.1/src/evmctl.c:168:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char name[strlen(file) + (ext ? strlen(ext) : 0) + 2]; data/ima-evm-utils-1.1/src/evmctl.c:197:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(list); data/ima-evm-utils-1.1/src/evmctl.c:386:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). err = strlen(selinux_str) + 1; data/ima-evm-utils-1.1/src/evmctl.c:388:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hex2bin(xattr_value, ima_str, strlen(ima_str) / 2); data/ima-evm-utils-1.1/src/evmctl.c:389:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). err = strlen(ima_str) / 2; data/ima-evm-utils-1.1/src/evmctl.c:394:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). err = strlen(caps_str); data/ima-evm-utils-1.1/src/evmctl.c:697:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hashlen = token ? token - line : strlen(line); data/ima-evm-utils-1.1/src/evmctl.c:852:56: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bin2file(inkey, "keyid", (const unsigned char *)name, strlen(name)); data/ima-evm-utils-1.1/src/evmctl.c:1186:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(list); data/ima-evm-utils-1.1/src/evmctl.c:1381:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(algo) + 1; data/ima-evm-utils-1.1/src/libimaevm.c:231:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). err = EVP_DigestUpdate(ctx, de->d_name, strlen(de->d_name)); ANALYSIS SUMMARY: Hits = 91 Lines analyzed = 2993 in approximately 0.11 seconds (26199 lines/second) Physical Source Lines of Code (SLOC) = 2354 Hits@level = [0] 24 [1] 14 [2] 66 [3] 1 [4] 9 [5] 1 Hits@level+ = [0+] 115 [1+] 91 [2+] 77 [3+] 11 [4+] 10 [5+] 1 Hits/KSLOC@level+ = [0+] 48.853 [1+] 38.6576 [2+] 32.7103 [3+] 4.6729 [4+] 4.24809 [5+] 0.424809 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.