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/pd-py-0.2.2+git20170625.1.88fc77a/source/register.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyprefix.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pydsp.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/modmeth.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pysymbol.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyargs.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyatom.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybundle.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/bound.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/main.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybundle.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pymeth.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/main.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/py.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybuffer.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybuffer.h Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/clmeth.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pysymbol.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyatom.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp Examining data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.h FINAL RESULTS: data/pd-py-0.2.2+git20170625.1.88fc77a/source/py.cpp:149:13: [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(modnm,sn); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:352: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(fname,mname); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:360:20: [4] (shell) ShellExecute: 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 err = (int)ShellExecute(NULL,"edit",fname,NULL,NULL,SW_SHOW); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:363:20: [4] (shell) ShellExecute: 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. err = (int)ShellExecute(NULL,NULL,"notepad.exe",fname,NULL,SW_SHOW); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:411:9: [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(cmd,editor); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:413:9: [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(cmd,fname); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:414:9: [4] (shell) execl: 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. execl("/bin/sh", "sh", "-c", cmd, (char *) NULL); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:488: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(smod,mod); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:489:5: [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(smod,ext); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:496:9: [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(smod,mod); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:505:13: [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(end,mod); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:507:13: [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(end,ext); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:534:13: [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(dir,smod); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:535:13: [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(dir,colon+1); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:538:13: [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(dir,smod); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:618:17: [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(dir,modname.c_str()+p+1); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:155:13: [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(modnm,GetString(scr)); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:574:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str,"%s_%i",GetString(s),n); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:601:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str,"%s_",GetString(s)); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:401:20: [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. char *editor = getenv("EDITOR"); data/pd-py-0.2.2+git20170625.1.88fc77a/source/py.cpp:148:13: [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 modnm[64]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:328:21: [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/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:351: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 fname[1024]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:356:36: [2] (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). Risk is low because the source is a constant string. if(dt && !strncmp(dt,".py",2)) strcpy(dt,".py"); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:410:9: [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[80]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:424:24: [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 **sargv = new char *[argc+1]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:428:13: [2] (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). Risk is low because the source is a constant string. strcpy(sargv[i],"py/pyext"); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:487: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 smod[1024]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:506:13: [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(end,"/__init__"); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:510:23: [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 *f = fopen(smod,"r"); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:533:13: [2] (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). Risk is low because the source is a constant string. strcpy(dir,"/Volumes/"); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:603:13: [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 dir[1024]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:664: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 dir[1024]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:154:13: [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 modnm[64]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:566: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 str[256]; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:582:13: [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,"int_%i",n); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:588:13: [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,"float_%i",n); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pyext.cpp:595:9: [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,"_anything_%i",n); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:332:21: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf,s,l); // copy all but newline data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:412:9: [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(cmd," "); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:473: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). char *t = dir+strlen(dir)-l; data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:482:21: [1] (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). Risk is low because the source is a constant character. if(dir == name) strcpy(dir,"."); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pybase.cpp:504: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). char *end = smod+strlen(smod); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pysymbol.cpp:93: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). return strlen(flext::GetString(self->sym)); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pysymbol.cpp:100: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). int len = strlen(str); data/pd-py-0.2.2+git20170625.1.88fc77a/source/pysymbol.cpp:115: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). int len = strlen(str); ANALYSIS SUMMARY: Hits = 46 Lines analyzed = 6061 in approximately 0.14 seconds (42858 lines/second) Physical Source Lines of Code (SLOC) = 4617 Hits@level = [0] 11 [1] 8 [2] 18 [3] 1 [4] 19 [5] 0 Hits@level+ = [0+] 57 [1+] 46 [2+] 38 [3+] 20 [4+] 19 [5+] 0 Hits/KSLOC@level+ = [0+] 12.3457 [1+] 9.96318 [2+] 8.23045 [3+] 4.33182 [4+] 4.11523 [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.