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/python-cpl-0.7.4/test/rtest.c Examining data/python-cpl-0.7.4/cpl/CPL_library.h Examining data/python-cpl-0.7.4/cpl/cpl_api.h Examining data/python-cpl-0.7.4/cpl/CPL_library.c Examining data/python-cpl-0.7.4/cpl/CPL_recipe.c FINAL RESULTS: data/python-cpl-0.7.4/cpl/CPL_recipe.c:621:5: [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(buf + *((long *)buf), str); data/python-cpl-0.7.4/cpl/CPL_recipe.c:708:16: [4] (shell) system: 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. int retval = system(cmd); data/python-cpl-0.7.4/cpl/CPL_recipe.c:712:13: [4] (shell) system: 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. retval |= system(cmd); data/python-cpl-0.7.4/cpl/CPL_recipe.c:723:16: [4] (shell) system: 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. int retval = system(cmd); data/python-cpl-0.7.4/cpl/CPL_recipe.c:735:16: [4] (shell) system: 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. int retval = system(cmd); data/python-cpl-0.7.4/test/rtest.c:443:27: [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. const char *testenv = getenv("TESTENV"); data/python-cpl-0.7.4/cpl/CPL_recipe.c:628:5: [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 + *((long *)buf), src, nbytes); data/python-cpl-0.7.4/cpl/CPL_recipe.c:703: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 cmd[300]; data/python-cpl-0.7.4/cpl/CPL_recipe.c:720: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 cmd[100]; data/python-cpl-0.7.4/cpl/CPL_recipe.c:732: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 cmd[100]; data/python-cpl-0.7.4/cpl/CPL_recipe.c:598: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). index += strlen(error_msg) + 1; data/python-cpl-0.7.4/cpl/CPL_recipe.c:600: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). index += strlen(error_file) + 1; data/python-cpl-0.7.4/cpl/CPL_recipe.c:602: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). index += strlen(error_func) + 1; data/python-cpl-0.7.4/cpl/CPL_recipe.c:610: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). index += strlen(tag) + 1; data/python-cpl-0.7.4/cpl/CPL_recipe.c:612: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). index += strlen(file) + 1; data/python-cpl-0.7.4/cpl/CPL_recipe.c:620: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). buf = realloc(buf, ((long *)buf)[0] + strlen(str) + 1); data/python-cpl-0.7.4/cpl/CPL_recipe.c:622:23: [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). *((long *)buf) += strlen(str) + 1; data/python-cpl-0.7.4/cpl/CPL_recipe.c:910:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nbytes = read(fd[0], ptr, 2 * sizeof(long)); data/python-cpl-0.7.4/cpl/CPL_recipe.c:917:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nbytes2 = read(fd[0], ptr + 2 * sizeof(long), data/python-cpl-0.7.4/test/rtest.c:421:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep((unsigned int)(1e6*sleep_secs)); ANALYSIS SUMMARY: Hits = 20 Lines analyzed = 2096 in approximately 0.10 seconds (21973 lines/second) Physical Source Lines of Code (SLOC) = 1710 Hits@level = [0] 4 [1] 10 [2] 4 [3] 1 [4] 5 [5] 0 Hits@level+ = [0+] 24 [1+] 20 [2+] 10 [3+] 6 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 14.0351 [1+] 11.6959 [2+] 5.84795 [3+] 3.50877 [4+] 2.92398 [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.