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/vgrabbj-0.9.9/src/vgrabbj.c Examining data/vgrabbj-0.9.9/src/font.c Examining data/vgrabbj-0.9.9/src/v_ftp.c Examining data/vgrabbj-0.9.9/src/v_config.c Examining data/vgrabbj-0.9.9/src/v_ftp.h Examining data/vgrabbj-0.9.9/src/v_writer.c Examining data/vgrabbj-0.9.9/src/ccvt_c.c Examining data/vgrabbj-0.9.9/src/v_plist.h Examining data/vgrabbj-0.9.9/src/v_utils.c Examining data/vgrabbj-0.9.9/src/v_stamp.h Examining data/vgrabbj-0.9.9/src/v_options.h Examining data/vgrabbj-0.9.9/src/v_writer.h Examining data/vgrabbj-0.9.9/src/v_utils.h Examining data/vgrabbj-0.9.9/src/vgrabbj.h Examining data/vgrabbj-0.9.9/src/ccvt.h Examining data/vgrabbj-0.9.9/src/v_config.h Examining data/vgrabbj-0.9.9/src/v_stamp.c FINAL RESULTS: data/vgrabbj-0.9.9/src/v_config.c:165:23: [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). vconf->in = strcpy(malloc(strlen(DEFAULT_VIDEO_DEV)+1),DEFAULT_VIDEO_DEV); data/vgrabbj-0.9.9/src/v_config.c:166:23: [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). vconf->out = strcpy(malloc(strlen(DEFAULT_OUTPUT)+1),DEFAULT_OUTPUT); data/vgrabbj-0.9.9/src/v_config.c:167:23: [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). vconf->conf_file = strcpy(malloc(strlen(DEFAULT_CONFIG)+1),DEFAULT_CONFIG); data/vgrabbj-0.9.9/src/v_config.c:211:23: [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). vconf->font = strcpy(malloc(strlen(DEFAULT_FONT)+1),DEFAULT_FONT); data/vgrabbj-0.9.9/src/v_config.c:212:23: [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). vconf->timestamp = strcpy(malloc(strlen(DEFAULT_TIMESTAMP)+1),DEFAULT_TIMESTAMP); data/vgrabbj-0.9.9/src/v_config.c:580:12: [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). option=strcpy(malloc(strlen(line)+1), line); data/vgrabbj-0.9.9/src/v_config.c:586:25: [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). value=strip_white(strcpy(malloc(strlen(p)+1),p)); data/vgrabbj-0.9.9/src/v_config.c:614:11: [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). return (strcpy(malloc(strlen(string)+1), string)); data/vgrabbj-0.9.9/src/v_config.c:662:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(vconf->tmpout, "%s.tmp", vconf->out); data/vgrabbj-0.9.9/src/v_utils.c:297:11: [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). return (strcpy(malloc(++i),archive)); data/vgrabbj-0.9.9/src/v_utils.c:338: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). var=strcpy(malloc(t+1),value); data/vgrabbj-0.9.9/src/v_writer.c:201:6: [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(commands,vconf->commands); data/vgrabbj-0.9.9/src/v_writer.c:202:6: [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(strstr(commands,"%s"),out); data/vgrabbj-0.9.9/src/v_writer.c:203:6: [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((char *)commands+strlen(commands),(char *)cmd_file+1); data/vgrabbj-0.9.9/src/v_writer.c:204:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(commands,vconf->commands,out); data/vgrabbj-0.9.9/src/v_writer.c:214:10: [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. err = system(commands); data/vgrabbj-0.9.9/src/v_writer.c:250:29: [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). vconf->arch->filename=strcpy(realloc(vconf->arch->filename, strlen(ts)+1),ts); data/vgrabbj-0.9.9/src/vgrabbj.c:100:5: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buf, fmt, arg_ptr); data/vgrabbj-0.9.9/src/v_config.c:626:16: [3] (buffer) getopt: 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. while ( (n = getopt (argc, argv, opt_str) ) !=EOF ) { data/vgrabbj-0.9.9/src/font.c:42:17: [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. static unsigned char bounded_palette[8] = {0, 1, 2, 3, 4, 4, 4, 4}; data/vgrabbj-0.9.9/src/v_config.c:293:12: [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). if ( !(x=fopen(vconf->out, "w+"))) { data/vgrabbj-0.9.9/src/v_config.c:301:13: [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). if (!(x=fopen(vconf->font, "r"))) { data/vgrabbj-0.9.9/src/v_config.c:461:15: [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. vconf->out=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:462:14: [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. vconf->in=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:465:16: [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. vconf->font=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:466: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. vconf->timestamp=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:471:26: [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. vconf->ftp.remoteHost=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:472:31: [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. vconf->ftp.remoteImageName=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:473: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. vconf->ftp.username=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:474: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. vconf->ftp.password=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:476:25: [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. vconf->ftp.remoteDir=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:480:19: [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. vconf->archive=(char *)l_opt[i++].var; data/vgrabbj-0.9.9/src/v_config.c:482: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. vconf->commands=(char *)l_opt[i].var; data/vgrabbj-0.9.9/src/v_config.c:510:51: [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. l_opt[i].var=check_maxlen(vconf, get_str(value, (char *)l_opt[i].var), data/vgrabbj-0.9.9/src/v_config.c:557: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 line[MAX_LINE]; data/vgrabbj-0.9.9/src/v_config.c:563:15: [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). if (! (fd = fopen(vconf->conf_file, "r") ) ) { data/vgrabbj-0.9.9/src/v_config.c:605: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 string[255]; data/vgrabbj-0.9.9/src/v_utils.c:136: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(&a, vconf->o_buffer+(y*3),1); data/vgrabbj-0.9.9/src/v_utils.c:137: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(vconf->o_buffer+(y*3), vconf->o_buffer+(y*3)+2, 1); data/vgrabbj-0.9.9/src/v_utils.c:138: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(vconf->o_buffer+(y*3)+2, &a, 1); data/vgrabbj-0.9.9/src/v_utils.c:149: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(vconf->o_buffer+(y*3), vconf->buffer+(y*4), 3); data/vgrabbj-0.9.9/src/v_utils.c:286: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 archive[512]; data/vgrabbj-0.9.9/src/v_writer.c:133:18: [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). while ( (!(x = fopen(filename, "w+"))) && (!(err_count++ > 200)) ) data/vgrabbj-0.9.9/src/v_writer.c:143: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 buffer[1024]; data/vgrabbj-0.9.9/src/v_writer.c:147:14: [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). source = fopen (source_name, "r"); data/vgrabbj-0.9.9/src/vgrabbj.c:73:10: [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. static char buf[MAX_ERRORMSG_LENGTH]; data/vgrabbj-0.9.9/src/vgrabbj.c:272:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. vconf->buffer=memcpy(vconf->buffer, vconf->map+vconf->vbuf.offsets[vconf->vmap.frame], size); data/vgrabbj-0.9.9/src/vgrabbj.c:297:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. vconf->o_buffer=memcpy(vconf->o_buffer, vconf->buffer, data/vgrabbj-0.9.9/src/font.c:210:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). char *off, *read, *off2, *read2; data/vgrabbj-0.9.9/src/font.c:265:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). *off = bounded_palette[*off | *read]; data/vgrabbj-0.9.9/src/v_config.c:165: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). vconf->in = strcpy(malloc(strlen(DEFAULT_VIDEO_DEV)+1),DEFAULT_VIDEO_DEV); data/vgrabbj-0.9.9/src/v_config.c:166: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). vconf->out = strcpy(malloc(strlen(DEFAULT_OUTPUT)+1),DEFAULT_OUTPUT); data/vgrabbj-0.9.9/src/v_config.c:167: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). vconf->conf_file = strcpy(malloc(strlen(DEFAULT_CONFIG)+1),DEFAULT_CONFIG); data/vgrabbj-0.9.9/src/v_config.c:211: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). vconf->font = strcpy(malloc(strlen(DEFAULT_FONT)+1),DEFAULT_FONT); data/vgrabbj-0.9.9/src/v_config.c:212: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). vconf->timestamp = strcpy(malloc(strlen(DEFAULT_TIMESTAMP)+1),DEFAULT_TIMESTAMP); data/vgrabbj-0.9.9/src/v_config.c:580:26: [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). option=strcpy(malloc(strlen(line)+1), line); data/vgrabbj-0.9.9/src/v_config.c:582: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). if ( (strlen(option)>1) && (p=strpbrk(option," \t")) ) { data/vgrabbj-0.9.9/src/v_config.c:586:39: [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). value=strip_white(strcpy(malloc(strlen(p)+1),p)); data/vgrabbj-0.9.9/src/v_config.c:614: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). return (strcpy(malloc(strlen(string)+1), string)); data/vgrabbj-0.9.9/src/v_config.c:661:26: [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). vconf->tmpout=malloc(strlen(vconf->out)+6); data/vgrabbj-0.9.9/src/v_stamp.c:63: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). ts_len = strlen(ts_buff=timestring(vconf->timestamp)); data/vgrabbj-0.9.9/src/v_utils.c:65: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(25000); data/vgrabbj-0.9.9/src/v_utils.c:305:7: [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). tmp=strlen(value); data/vgrabbj-0.9.9/src/v_utils.c:324:32: [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 ( (ll_opt.max_length) && (strlen((value)) > ll_opt.max_length) ) data/vgrabbj-0.9.9/src/v_utils.c:335: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). if ( (t=strlen(value))<1 ) data/vgrabbj-0.9.9/src/v_writer.c:134: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(25000); data/vgrabbj-0.9.9/src/v_writer.c:199: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). commands = malloc(strlen(vconf->commands)+strlen(out)+1); data/vgrabbj-0.9.9/src/v_writer.c:199:47: [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). commands = malloc(strlen(vconf->commands)+strlen(out)+1); data/vgrabbj-0.9.9/src/v_writer.c:203: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). strcpy((char *)commands+strlen(commands),(char *)cmd_file+1); data/vgrabbj-0.9.9/src/v_writer.c:250:67: [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). vconf->arch->filename=strcpy(realloc(vconf->arch->filename, strlen(ts)+1),ts); data/vgrabbj-0.9.9/src/vgrabbj.c:101:5: [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(buf, "\n"); data/vgrabbj-0.9.9/src/vgrabbj.c:393: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(vconf->loop); ANALYSIS SUMMARY: Hits = 72 Lines analyzed = 3786 in approximately 0.13 seconds (29941 lines/second) Physical Source Lines of Code (SLOC) = 2703 Hits@level = [0] 19 [1] 24 [2] 29 [3] 1 [4] 18 [5] 0 Hits@level+ = [0+] 91 [1+] 72 [2+] 48 [3+] 19 [4+] 18 [5+] 0 Hits/KSLOC@level+ = [0+] 33.6663 [1+] 26.6371 [2+] 17.758 [3+] 7.02923 [4+] 6.65927 [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.