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/tudu-0.10.4/src/config.h Examining data/tudu-0.10.4/src/tudu.cc Examining data/tudu-0.10.4/src/window.cc Examining data/tudu-0.10.4/src/interface.h Examining data/tudu-0.10.4/src/includes.h Examining data/tudu-0.10.4/src/config.cc Examining data/tudu-0.10.4/src/date.h Examining data/tudu-0.10.4/src/screen.cc Examining data/tudu-0.10.4/src/data.h Examining data/tudu-0.10.4/src/scheduler.h Examining data/tudu-0.10.4/src/cmd.h Examining data/tudu-0.10.4/src/parser.cc Examining data/tudu-0.10.4/src/interface.cc Examining data/tudu-0.10.4/src/scheduler.cc Examining data/tudu-0.10.4/src/date.cc Examining data/tudu-0.10.4/src/text.h Examining data/tudu-0.10.4/src/editor.cc Examining data/tudu-0.10.4/src/text.cc Examining data/tudu-0.10.4/src/editor.h Examining data/tudu-0.10.4/src/window.h Examining data/tudu-0.10.4/src/cmd.cc Examining data/tudu-0.10.4/src/screen.h Examining data/tudu-0.10.4/src/parser.h Examining data/tudu-0.10.4/src/data.cc FINAL RESULTS: data/tudu-0.10.4/src/cmd.cc:118:4: [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. execvp(argv[0],argv); data/tudu-0.10.4/src/interface.cc:781:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(s, editor, template_name); data/tudu-0.10.4/src/interface.cc:796:5: [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. execvp(argv[0],argv); data/tudu-0.10.4/src/screen.cc:189:3: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(str, 11, L"%2d/%2d/%4d", date.month(), date.day(), date.year()); data/tudu-0.10.4/src/screen.cc:193:3: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(str, 11, L"%2d/%2d/%4d", date.day(), date.month(), date.year()); data/tudu-0.10.4/src/screen.cc:711:3: [4] (format) swprintf: Potential format string problem (CWE-134). Make format string constant. swprintf(p, 2, L"%01d", priority); data/tudu-0.10.4/src/tudu.cc:180:2: [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(file_lock,file_xml); data/tudu-0.10.4/src/tudu.cc:187:3: [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(file_lock, file_xml+i); data/tudu-0.10.4/src/config.cc:49: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). file.open(path); data/tudu-0.10.4/src/config.cc:122: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 path[256]; data/tudu-0.10.4/src/config.cc:161: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 num[5]; data/tudu-0.10.4/src/config.cc:163:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). days_warn_deadline = atoi(num); data/tudu-0.10.4/src/config.cc:319: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 num[5]; data/tudu-0.10.4/src/config.cc:321:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). row.height = atoi(num); data/tudu-0.10.4/src/config.cc:360:4: [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 num[5]; data/tudu-0.10.4/src/config.cc:362:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). w.width = atoi(num); data/tudu-0.10.4/src/config.cc:367:4: [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 num[5]; data/tudu-0.10.4/src/config.cc:369:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). w.width = atoi(num); data/tudu-0.10.4/src/config.cc:450: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 num[5]; data/tudu-0.10.4/src/config.cc:452:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). category_length = atoi(num); data/tudu-0.10.4/src/config.cc:506: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 num[5]; data/tudu-0.10.4/src/config.cc:512:28: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). colors[num_colors].red = atoi(num); data/tudu-0.10.4/src/config.cc:517:30: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). colors[num_colors].green = atoi(num); data/tudu-0.10.4/src/config.cc:522:29: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). colors[num_colors].blue = atoi(num); data/tudu-0.10.4/src/config.h:142: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 editor[64]; data/tudu-0.10.4/src/interface.cc:766: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 s[86]; data/tudu-0.10.4/src/interface.cc:774:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fout=mkstemp(template_name); data/tudu-0.10.4/src/parser.cc:25: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). file.open(path); data/tudu-0.10.4/src/parser.cc:156: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 num[3]; data/tudu-0.10.4/src/parser.cc:158:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int day = atoi(num); data/tudu-0.10.4/src/parser.cc:172: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 num[3]; data/tudu-0.10.4/src/parser.cc:174:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int month = atoi(num); data/tudu-0.10.4/src/parser.cc:188: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 num[5]; data/tudu-0.10.4/src/parser.cc:190:14: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int year = atoi(num); data/tudu-0.10.4/src/parser.cc:204: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 num[8]; data/tudu-0.10.4/src/parser.cc:206:31: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). iterator->schedPosition() = atoi(num); data/tudu-0.10.4/src/parser.cc:214: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 num[2]; data/tudu-0.10.4/src/parser.cc:216:26: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). iterator->priority() = atoi(num); data/tudu-0.10.4/src/parser.cc:279: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). file.open(path); data/tudu-0.10.4/src/parser.cc:333:4: [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[10]; /* fixing problem with locales that prints 2,010 */ data/tudu-0.10.4/src/parser.cc:334:4: [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,"%i",date.year()); data/tudu-0.10.4/src/parser.cc:375:4: [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[10]; /* fixing problem with locales that prints 2,010 */ data/tudu-0.10.4/src/parser.cc:376:4: [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,"%i",date.year()); data/tudu-0.10.4/src/parser.h:60: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[256]; data/tudu-0.10.4/src/screen.cc:185:2: [2] (buffer) wchar_t: 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. wchar_t str[11]; data/tudu-0.10.4/src/screen.cc:205:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int year = atoi(date.substr(6,4).c_str()); data/tudu-0.10.4/src/screen.cc:208:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). month = atoi(date.substr(0,2).c_str()); data/tudu-0.10.4/src/screen.cc:209:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). day = atoi(date.substr(3,2).c_str()); data/tudu-0.10.4/src/screen.cc:213:9: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). day = atoi(date.substr(0,2).c_str()); data/tudu-0.10.4/src/screen.cc:214:11: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). month = atoi(date.substr(3,2).c_str()); data/tudu-0.10.4/src/screen.cc:407: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[8]; data/tudu-0.10.4/src/screen.cc:408: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, "%2d%% ", chinf.percent); data/tudu-0.10.4/src/screen.cc:434:4: [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 s[11]; data/tudu-0.10.4/src/screen.cc:436:4: [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(s, "%01d", priority); data/tudu-0.10.4/src/screen.cc:709:2: [2] (buffer) wchar_t: 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. wchar_t p[2] = L"N"; data/tudu-0.10.4/src/screen.cc:718: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 num[2]; data/tudu-0.10.4/src/screen.cc:720:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). priority = atoi(num); data/tudu-0.10.4/src/screen.cc:866: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 str[8]; data/tudu-0.10.4/src/screen.cc:867: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(str, "(%3d%%)", percent); data/tudu-0.10.4/src/tudu.cc:83: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 file_rc[128], file_xml[128], file_lock[133]; data/tudu-0.10.4/src/tudu.cc:189: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(file_lock,"_lock"); data/tudu-0.10.4/src/tudu.cc:192:9: [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). lock = open(file_lock, O_CREAT|O_EXCL, 00666); data/tudu-0.10.4/src/interface.cc:764:6: [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(editor) != 0) data/tudu-0.10.4/src/parser.cc:270:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, pathToSave, 255); data/tudu-0.10.4/src/tudu.cc:95:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_rc,env[i]+5,119); data/tudu-0.10.4/src/tudu.cc:97:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(file_rc,"/.tudurc", 9); data/tudu-0.10.4/src/tudu.cc:101:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_xml,env[i]+5,117); data/tudu-0.10.4/src/tudu.cc:103:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(file_xml,"/.tudu.xml", 11); data/tudu-0.10.4/src/tudu.cc:117:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_xml, argv[i], 127); data/tudu-0.10.4/src/tudu.cc:135:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_rc,env[j]+4,99); data/tudu-0.10.4/src/tudu.cc:137:6: [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(file_rc,"/"); data/tudu-0.10.4/src/tudu.cc:138:6: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(file_rc,argv[i],27); data/tudu-0.10.4/src/tudu.cc:142:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(file_rc, argv[i], 127); data/tudu-0.10.4/src/tudu.cc:181: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). for (i = strlen(file_lock); (file_lock[i] != '/') && (i > 0); i--); ANALYSIS SUMMARY: Hits = 74 Lines analyzed = 7354 in approximately 0.18 seconds (41343 lines/second) Physical Source Lines of Code (SLOC) = 5969 Hits@level = [0] 11 [1] 12 [2] 54 [3] 0 [4] 8 [5] 0 Hits@level+ = [0+] 85 [1+] 74 [2+] 62 [3+] 8 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 14.2402 [1+] 12.3974 [2+] 10.387 [3+] 1.34026 [4+] 1.34026 [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.