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/popt-1.18/src/popt.h Examining data/popt-1.18/src/poptparse.c Examining data/popt-1.18/src/poptint.c Examining data/popt-1.18/src/poptconfig.c Examining data/popt-1.18/src/system.h Examining data/popt-1.18/src/popthelp.c Examining data/popt-1.18/src/lookup3.c Examining data/popt-1.18/src/popt.c Examining data/popt-1.18/src/poptint.h Examining data/popt-1.18/tests/test1.c Examining data/popt-1.18/tests/test2.c Examining data/popt-1.18/tests/tdict.c FINAL RESULTS: data/popt-1.18/src/popt.c:430:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!access(t, X_OK)) data/popt-1.18/src/popt.c:532:10: [4] (shell) execvp: 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. rc = execvp(argv[0], (char *const *)argv); data/popt-1.18/src/popt.c:1207:2: [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. fprintf(stdout, POPT_("option type (%u) not implemented in popt\n"), data/popt-1.18/src/popthelp.c:359:7: [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(te, defs); data/popt-1.18/src/popthelp.c:395:9: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. le += sprintf(le, (ops ? "0x%lx" : "%ld"), aLong); data/popt-1.18/src/popthelp.c:461:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(format, "%%s\n%%%ds", (int) indentLength); data/popt-1.18/src/poptint.c:159:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. rc = vsnprintf(b, nb, format, ap); data/popt-1.18/src/poptparse.c:193:6: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(argstr, p); data/popt-1.18/src/poptparse.c:222:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(argstr, p); data/popt-1.18/src/poptparse.c:224:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(argstr, q); data/popt-1.18/src/system.h:48:26: [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). #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str))) data/popt-1.18/src/popt.c:184:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("POSIXLY_CORRECT") || getenv("POSIX_ME_HARDER")) data/popt-1.18/src/popt.c:184:38: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("POSIXLY_CORRECT") || getenv("POSIX_ME_HARDER")) data/popt-1.18/src/popt.c:415:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((path = getenv("PATH")) == NULL || (path = xstrdup(path)) == NULL) data/popt-1.18/src/popt.c:919:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)getpid()); data/popt-1.18/src/popt.c:920:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:920:24: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:922:26: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. aLongLong = (long long)(random() % (aLongLong > 0 ? aLongLong : -aLongLong)); data/popt-1.18/src/popt.c:960:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)getpid()); data/popt-1.18/src/popt.c:961:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:961:24: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:963:10: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. aLong = random() % (aLong > 0 ? aLong : -aLong); data/popt-1.18/src/popt.c:993:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)getpid()); data/popt-1.18/src/popt.c:994:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:994:24: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:996:10: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. aLong = random() % (aLong > 0 ? aLong : -aLong); data/popt-1.18/src/popt.c:1026:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)getpid()); data/popt-1.18/src/popt.c:1027:6: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:1027:24: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom((unsigned)random()); data/popt-1.18/src/popt.c:1029:10: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. aLong = random() % (aLong > 0 ? aLong : -aLong); data/popt-1.18/src/poptconfig.c:464:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((home = getenv("HOME"))) { data/popt-1.18/src/system.h:57:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. #define getenv(_s) secure_getenv(_s) data/popt-1.18/src/system.h:59:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. #define getenv(_s) __secure_getenv(_s) data/popt-1.18/src/lookup3.c:48:20: [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 unsigned char uc[4]; data/popt-1.18/src/popt.c:475: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(argv + argc, item->argv + 1, sizeof(*argv) * (item->argc - 1)); data/popt-1.18/src/popt.c:480: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(argv + argc, con->finalArgv, data/popt-1.18/src/popt.c:486: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(argv + argc, con->leftovers, sizeof(*argv) * con->numLeftovers); data/popt-1.18/src/poptconfig.c:47:6: [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). if (open) data/popt-1.18/src/poptconfig.c:134: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). fdno = open(fn, O_RDONLY); data/popt-1.18/src/popthelp.c:226:8: [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. le += sprintf(le, "%d", arg.intp[0]); data/popt-1.18/src/popthelp.c:229:8: [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. le += sprintf(le, "%hd", arg.shortp[0]); data/popt-1.18/src/popthelp.c:232:8: [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. le += sprintf(le, "%ld", arg.longp[0]); data/popt-1.18/src/popthelp.c:235:8: [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. le += sprintf(le, "%lld", arg.longlongp[0]); data/popt-1.18/src/popthelp.c:239:8: [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. le += sprintf(le, "%g", aDouble); data/popt-1.18/src/popthelp.c:242:8: [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. le += sprintf(le, "%g", arg.doublep[0]); data/popt-1.18/src/popthelp.c:245:8: [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. le += sprintf(le, "%p", opt->arg); data/popt-1.18/src/popthelp.c:248:8: [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. le += sprintf(le, "%p", opt->arg); data/popt-1.18/src/popthelp.c:444: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 format[16]; data/popt-1.18/src/poptparse.c:134:5: [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 line[999]; data/popt-1.18/src/poptparse.c:192:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(argstr, " --"); data/popt-1.18/src/poptparse.c:221:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(argstr, " --"); data/popt-1.18/src/poptparse.c:223:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(argstr, "=\""); data/popt-1.18/tests/tdict.c:17:5: [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 b[BUFSIZ]; data/popt-1.18/tests/tdict.c:19:17: [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). FILE * fp = fopen(fn, "r"); data/popt-1.18/src/popt.c:272:37: [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 *s = malloc((longName ? strlen(longName) : 0) + sizeof("--")); data/popt-1.18/src/popt.c:320:16: [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). rc = (int)(strlen(optLongName) == longNameLen); data/popt-1.18/src/popt.c:419:21: [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). if ((t = malloc(strlen(path) + strlen(argv0) + sizeof("/"))) != NULL) data/popt-1.18/src/popt.c:419: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). if ((t = malloc(strlen(path) + strlen(argv0) + sizeof("/"))) != NULL) data/popt-1.18/src/popt.c:462:19: [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 *s = malloc(strlen(con->execPath) + strlen(item->argv[0]) + sizeof("/")); data/popt-1.18/src/popt.c:462: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). char *s = malloc(strlen(con->execPath) + strlen(item->argv[0]) + sizeof("/")); data/popt-1.18/src/popt.c:646:17: [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). size_t tn = strlen(s) + 1; data/popt-1.18/src/popt.c:669: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). tn += strlen(a); data/popt-1.18/src/popt.c:725:22: [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). size_t ns = (s ? strlen(s) : 0); data/popt-1.18/src/popt.c:744:22: [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). size_t ns = (s ? strlen(s) : 0); data/popt-1.18/src/popt.c:778:22: [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). size_t ns = (s ? strlen(s) : 0); data/popt-1.18/src/popt.c:1449:40: [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 *s = malloc((opt->longName ? strlen(opt->longName) : 0) + sizeof("--")); data/popt-1.18/src/poptconfig.c:141:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). || read(fdno, (char *)b, (size_t)nb) != (ssize_t)nb) data/popt-1.18/src/poptconfig.c:275:19: [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). size_t nse = strlen(se) + 1; data/popt-1.18/src/poptconfig.c:406:25: [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). pe = (char *) (p + strlen(p)); data/popt-1.18/src/poptconfig.c:465:21: [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 * fn = malloc(strlen(home) + 20); data/popt-1.18/src/popthelp.c:120:16: [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). size_t n = strlen(s); data/popt-1.18/src/popthelp.c:258:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(le, s, limit); le[limit] = '\0'; le += (slen = strlen(le)); data/popt-1.18/src/popthelp.c:258:61: [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). strncpy(le, s, limit); le[limit] = '\0'; le += (slen = strlen(le)); data/popt-1.18/src/popthelp.c:302:30: [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). if (opt->longName) nb += strlen(opt->longName); data/popt-1.18/src/popthelp.c:304:27: [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). if (argDescrip) nb += strlen(argDescrip); data/popt-1.18/src/popthelp.c:343:21: [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 * le = left + strlen(left); data/popt-1.18/src/popthelp.c:352:29: [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 * t = malloc((help ? strlen(help) : 0) + data/popt-1.18/src/popthelp.c:353:5: [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). strlen(defs) + sizeof(" ")); data/popt-1.18/src/popthelp.c:441:18: [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). helpLength = strlen(help); data/popt-1.18/src/popthelp.c:470:15: [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). helpLength = strlen(help); data/popt-1.18/src/popthelp.c:510: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(opt->longName); data/popt-1.18/src/popthelp.c:624: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(fn) + 1; data/popt-1.18/src/popthelp.c:674: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(opt->longName); data/popt-1.18/src/popthelp.c:826:5: [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). s[strlen(s)] = opt->shortName; data/popt-1.18/src/popthelp.c:840: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(s) + sizeof(" [-]")-1; data/popt-1.18/src/popthelp.c:870:18: [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). columns->cur += strlen(con->otherHelp) + 1; data/popt-1.18/src/poptint.c:86:14: [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). size_t db = strlen(istr); data/popt-1.18/src/poptparse.c:26: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). nb += strlen(argv[i]) + 1; data/popt-1.18/src/poptparse.c:61:21: [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). size_t buflen = strlen(s) + 1; data/popt-1.18/src/poptparse.c:114: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). if (strlen(argv[argc])) { data/popt-1.18/src/poptparse.c:164: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). linelen = strlen(p); data/popt-1.18/src/poptparse.c:225:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(argstr, "\""); data/popt-1.18/src/system.h:48:41: [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). #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str))) data/popt-1.18/tests/tdict.c:29:11: [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). te = t + strlen(t); ANALYSIS SUMMARY: Hits = 94 Lines analyzed = 5892 in approximately 0.22 seconds (27360 lines/second) Physical Source Lines of Code (SLOC) = 4250 Hits@level = [0] 69 [1] 40 [2] 21 [3] 22 [4] 11 [5] 0 Hits@level+ = [0+] 163 [1+] 94 [2+] 54 [3+] 33 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 38.3529 [1+] 22.1176 [2+] 12.7059 [3+] 7.76471 [4+] 2.58824 [5+] 0 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.