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/ftnchek-3.3.1/advance.c Examining data/ftnchek-3.3.1/advance.h Examining data/ftnchek-3.3.1/argcheck.c Examining data/ftnchek-3.3.1/block_match.h Examining data/ftnchek-3.3.1/calltree.c Examining data/ftnchek-3.3.1/comcheck.c Examining data/ftnchek-3.3.1/config-generic.h Examining data/ftnchek-3.3.1/config-win32.h Examining data/ftnchek-3.3.1/exprtype.c Examining data/ftnchek-3.3.1/forlex.c Examining data/ftnchek-3.3.1/forlex.h Examining data/ftnchek-3.3.1/fortran.c Examining data/ftnchek-3.3.1/ftnchek.c Examining data/ftnchek-3.3.1/ftnchek.h Examining data/ftnchek-3.3.1/include.c Examining data/ftnchek-3.3.1/intake.c Examining data/ftnchek-3.3.1/intrins.c Examining data/ftnchek-3.3.1/intrins.h Examining data/ftnchek-3.3.1/iokeywds.h Examining data/ftnchek-3.3.1/iokeywds_enum.h Examining data/ftnchek-3.3.1/iokeywds.c Examining data/ftnchek-3.3.1/keywords.c Examining data/ftnchek-3.3.1/labels.c Examining data/ftnchek-3.3.1/loccheck.c Examining data/ftnchek-3.3.1/loccheck.h Examining data/ftnchek-3.3.1/makedcls.c Examining data/ftnchek-3.3.1/makehtml.c Examining data/ftnchek-3.3.1/message.c Examining data/ftnchek-3.3.1/options.c Examining data/ftnchek-3.3.1/options.h Examining data/ftnchek-3.3.1/pgsymtab.c Examining data/ftnchek-3.3.1/pgsymtab.h Examining data/ftnchek-3.3.1/plsymtab.c Examining data/ftnchek-3.3.1/plsymtab.h Examining data/ftnchek-3.3.1/prlists.c Examining data/ftnchek-3.3.1/prlocsym.c Examining data/ftnchek-3.3.1/project.c Examining data/ftnchek-3.3.1/symspace.c Examining data/ftnchek-3.3.1/symspace.h Examining data/ftnchek-3.3.1/symtab.c Examining data/ftnchek-3.3.1/symtab.h Examining data/ftnchek-3.3.1/symutils.c Examining data/ftnchek-3.3.1/symutils.h Examining data/ftnchek-3.3.1/tokdefs.h Examining data/ftnchek-3.3.1/utils.h Examining data/ftnchek-3.3.1/utils.c Examining data/ftnchek-3.3.1/test/Include/stats.h Examining data/ftnchek-3.3.1/test/cmp.c FINAL RESULTS: data/ftnchek-3.3.1/argcheck.c:308: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(sizebuf,ulongtostr((unsigned long)size1)); data/ftnchek-3.3.1/argcheck.c:312: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(sizebuf,ulongtostr((unsigned long)(a1[i].size))); data/ftnchek-3.3.1/argcheck.c:320: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(sizebuf,ulongtostr((unsigned long)size2)); data/ftnchek-3.3.1/argcheck.c:324: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(sizebuf,ulongtostr((unsigned long)(a2[i].size))); data/ftnchek-3.3.1/calltree.c:142:16: [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). ( void ) strcpy( newname + len, ext ); data/ftnchek-3.3.1/calltree.c:158:22: [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). ( void ) strcpy( newname + len, ext ); data/ftnchek-3.3.1/calltree.c:173:19: [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). ( void ) strcpy( newname, s ); data/ftnchek-3.3.1/calltree.c:174:19: [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). ( void ) strcat( newname, ext ); data/ftnchek-3.3.1/calltree.c:291:11: [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. (void)fprintf(vcg_fd,VCG_GRAPH_OPTIONS); data/ftnchek-3.3.1/calltree.c:587:13: [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. (void)fprintf(list_fd,fmt,""); data/ftnchek-3.3.1/comcheck.c:215:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(msg,"Has %ld %s%s", data/ftnchek-3.3.1/comcheck.c:220:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(msg,"Has %ld %s%s", data/ftnchek-3.3.1/comcheck.c:313:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(msg,"%s %ld is type %s", data/ftnchek-3.3.1/comcheck.c:318:12: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(msg,"%s %ld is type %s", data/ftnchek-3.3.1/comcheck.c:362:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(msg,"Has %d variable%s", data/ftnchek-3.3.1/comcheck.c:365:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(msg,"Has %d variable%s", data/ftnchek-3.3.1/exprtype.c:153:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(strbuf,"%4s*%ld", /* type*size */ data/ftnchek-3.3.1/forlex.c:137: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). (void)strcpy(legal_chars,f77_legal_chars); data/ftnchek-3.3.1/fortran.c:2172:21: [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. # define YYFPRINTF fprintf data/ftnchek-3.3.1/ftnchek.c:687:10: [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). (void)strcpy(newname+len,ext); data/ftnchek-3.3.1/ftnchek.c:697:14: [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). (void)strcpy(newname+len,ext); data/ftnchek-3.3.1/ftnchek.c:708: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). (void)strcpy(newname,s); data/ftnchek-3.3.1/ftnchek.c:709:12: [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). (void)strcat(newname,ext); data/ftnchek-3.3.1/include.c:432: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). (void)strcpy(tmpname,inc_path); data/ftnchek-3.3.1/include.c:442:11: [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). (void)strcat(tmpname,*fname); data/ftnchek-3.3.1/intake.c:67:4: [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(thisLine->line,linebuf); data/ftnchek-3.3.1/labels.c:913:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(detail, " <%d> %s", label, string); data/ftnchek-3.3.1/loccheck.c:323:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(detail," %s %s",list[i]->name,tag); data/ftnchek-3.3.1/loccheck.c:333:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(detail," %s %s",list[i]->name,tag); data/ftnchek-3.3.1/makedcls.c:404:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(begin, data/ftnchek-3.3.1/makehtml.c:278:36: [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). if ( (n = strspn( str, " " )) ) strcpy( str, &str[n] ); data/ftnchek-3.3.1/makehtml.c:426:3: [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(linein,srcPtr->line); data/ftnchek-3.3.1/makehtml.c:483:16: [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). (void)strcat( buffer, linein ); data/ftnchek-3.3.1/makehtml.c:484:16: [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). (void)strcat( buffer, buff_end ); data/ftnchek-3.3.1/makehtml.c:513:16: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( leader_srch, "%*s", min_leader, " " ); data/ftnchek-3.3.1/makehtml.c:522:16: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( leader_srch, "\n%*s", min_leader, " " ); data/ftnchek-3.3.1/makehtml.c:774:4: [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( modname, module->name ); data/ftnchek-3.3.1/makehtml.c:782:16: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf( module_str, "PROGRAM %s", modname ); data/ftnchek-3.3.1/makehtml.c:786:16: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf( module_str, "SUBROUTINE %s", modname ); data/ftnchek-3.3.1/makehtml.c:798:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( &module_str[n], " %s", modname ); data/ftnchek-3.3.1/makehtml.c:803:16: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf( module_str, "%s FUNCTION %s", type_table[mod_type], data/ftnchek-3.3.1/makehtml.c:1503:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( scope_str, "COMMON /%s/", cur_sym->common_block->name ); data/ftnchek-3.3.1/options.c:1201:11: [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). (void)strcat(strcpy(env_name,ENV_PREFIX),option_name); data/ftnchek-3.3.1/options.c:1201:18: [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). (void)strcat(strcpy(env_name,ENV_PREFIX),option_name); data/ftnchek-3.3.1/options.c:1270: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). (void)strcpy(fname,UNIX_RC_FILE); data/ftnchek-3.3.1/options.c:1274: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). (void)strcpy(fname,NONUNIX_RC_FILE); data/ftnchek-3.3.1/options.c:1287:8: [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). (void)strcpy(fname,homedir); data/ftnchek-3.3.1/options.c:1291:8: [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). (void)strcat(fname,UNIX_RC_FILE); data/ftnchek-3.3.1/options.c:1297:10: [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). (void)strcpy(fname,homedir); data/ftnchek-3.3.1/options.c:1301:10: [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). (void)strcat(fname,NONUNIX_RC_FILE); data/ftnchek-3.3.1/plsymtab.c:215:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. (void)sprintf(intro,"%s in module %s",problem,mod_name); data/ftnchek-3.3.1/plsymtab.c:322:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if( sprintf(msgbuf," %s %s", sym_list[i]->name, tag) data/ftnchek-3.3.1/project.c:142:36: [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. #define WRITE_STR(LEADER,S) (void)(fprintf(fd,LEADER), fprintf(fd," %s",S)) data/ftnchek-3.3.1/project.c:143:36: [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. #define WRITE_ARG(LEADER,S) (void)(fprintf(fd,LEADER), fprintf(fd," %s",S)) data/ftnchek-3.3.1/project.c:144:38: [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. #define WRITE_NUM(LEADER,NUM) (void)(fprintf(fd,LEADER), fprintf(fd," %ld",NUM)) data/ftnchek-3.3.1/project.c:459:37: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. #define READ_FIRST_STR(LEADER,STR) (fscanf(fd,LEADER), \ data/ftnchek-3.3.1/project.c:461:39: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. #define READ_STR(LEADER,STR) ((void)((fscanf(fd,LEADER)==0 &&\ data/ftnchek-3.3.1/project.c:463:39: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. #define READ_ARG(LEADER,STR) ((void)((fscanf(fd,LEADER)==0 && fgetc(fd)==' ' &&\ data/ftnchek-3.3.1/project.c:465:39: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. #define READ_NUM(LEADER,NUM) ((void)((fscanf(fd,LEADER)==0 &&\ data/ftnchek-3.3.1/project.c:467:40: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. #define READ_LONG(LEADER,NUM) ((void)((fscanf(fd,LEADER)==0 &&\ data/ftnchek-3.3.1/symspace.c:224:10: [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(glob_strspace+glob_str_bot,s); data/ftnchek-3.3.1/symspace.c:257:10: [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(curr_loc_strspace->strspace+orig_top,s); data/ftnchek-3.3.1/symtab.c:2695:33: [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. #define PrintObjSize(OBJ) (void)fprintf(list_fd,#OBJ " size = %d\n",sizeof(OBJ)) data/ftnchek-3.3.1/advance.c:843:19: [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(debug_lexer && getenv("VERBOSE")) { data/ftnchek-3.3.1/advance.c:876:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:894:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:968:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:986:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:995:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:1002:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:1011:19: [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(debug_lexer && getenv("VERBOSE")) { data/ftnchek-3.3.1/advance.c:1072:19: [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(debug_lexer && getenv("VERBOSE")) { data/ftnchek-3.3.1/advance.c:1138:19: [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(debug_lexer && getenv("VERBOSE")) { data/ftnchek-3.3.1/advance.c:1375:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:1422:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:1475:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:1487:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/advance.c:1493:19: [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(debug_lexer && getenv("VERBOSE")) data/ftnchek-3.3.1/ftnchek.h:95:13: [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. PROTO(char *getenv,(char *)); data/ftnchek-3.3.1/include.c:395:24: [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( (env_include_var=getenv(ENV_INCLUDE_VAR)) != NULL) { data/ftnchek-3.3.1/keywords.c:281:19: [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(debug_lexer && getenv("BISECTION")) { data/ftnchek-3.3.1/keywords.c:295:19: [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(debug_lexer && getenv("BISECTION")) { data/ftnchek-3.3.1/keywords.c:346:19: [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(debug_lexer && getenv("BISECTION")) { data/ftnchek-3.3.1/keywords.c:354:19: [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(debug_lexer && getenv("BISECTION")) { data/ftnchek-3.3.1/options.c:1129:19: [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( (value = getenv(env_option_name)) != (char *)NULL) { data/ftnchek-3.3.1/options.c:1140:19: [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( (value = getenv(env_option_name)) != (char *)NULL) { data/ftnchek-3.3.1/options.c:1159:19: [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( (value = getenv(env_option_name)) != (char *)NULL) { data/ftnchek-3.3.1/options.c:1247: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. char *homedir=getenv("HOME"); data/ftnchek-3.3.1/options.c:2349:6: [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("DEBUG")) { data/ftnchek-3.3.1/argcheck.c:299:12: [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 sizebuf[2+2*MAX_ULONGTOSTR]; data/ftnchek-3.3.1/argcheck.c:508:7: [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 locspec[10+3*sizeof(a2[i].common_index)]; data/ftnchek-3.3.1/argcheck.c:510:15: [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. (void)sprintf(locspec,"%ld:",a2[i].common_index); data/ftnchek-3.3.1/argcheck.c:513:15: [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. (void)sprintf(locspec,"somewhere"); data/ftnchek-3.3.1/calltree.c:586: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. (void)sprintf(fmt,"%%%ds",level*4); /* indent 4 spaces per nesting level */ data/ftnchek-3.3.1/comcheck.c:212:7: [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 msg[11+3*sizeof(words1)]; data/ftnchek-3.3.1/comcheck.c:310:6: [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 msg[15+MAX_TYPESPEC+3*sizeof(word1)]; data/ftnchek-3.3.1/comcheck.c:359: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 msg[15+3*sizeof(n1)]; data/ftnchek-3.3.1/exprtype.c:85:18: [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. PRIVATE unsigned char arith_expr_type[NumT][NumT]={ data/ftnchek-3.3.1/exprtype.c:101:18: [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. PRIVATE unsigned char rel_expr_type[NumT][NumT]={ data/ftnchek-3.3.1/exprtype.c:117:18: [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. PRIVATE unsigned char assignment_type[NumT][NumT]={ data/ftnchek-3.3.1/forlex.c:130: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. PRIVATE char legal_chars[sizeof(f77_legal_chars)]; data/ftnchek-3.3.1/forlex.c:257:6: [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 *)sptr)[i] = 0; data/ftnchek-3.3.1/forlex.h:117: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 src_text_buf[MAX_SRC_TEXT]; data/ftnchek-3.3.1/fortran.c:3488:12: [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. (void)sprintf(unnamed_block_data+4,"%02d", data/ftnchek-3.3.1/fortran.c:7561:29: [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. #define DBG_TOKNAME(CLASS) (char *)(yytname[YYTRANSLATE(CLASS)]) data/ftnchek-3.3.1/ftnchek.c:254:25: [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( (input_fd = fopen(infile,"r")) == (FILE *)NULL ) { data/ftnchek-3.3.1/ftnchek.c:259:22: [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). project_fd = fopen(projfile,"w"); data/ftnchek-3.3.1/ftnchek.c:267:25: [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). || (input_fd = fopen(projfile,"r")) == (FILE *)NULL) { data/ftnchek-3.3.1/ftnchek.c:269:20: [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( (input_fd = fopen(infile,"r")) == (FILE *)NULL ) { data/ftnchek-3.3.1/ftnchek.c:286:9: [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). fopen(dclfile,"w") : (FILE*)NULL; data/ftnchek-3.3.1/ftnchek.c:298:43: [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). htmlcalltree_fd = fopen( htmlcalltree_filename, "w" ); data/ftnchek-3.3.1/ftnchek.c:305:24: [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). fopen( html_filename, "w" ) : (FILE *)NULL; data/ftnchek-3.3.1/ftnchek.c:379:27: [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( (project_fd = fopen(projfile,"w")) == (FILE *)NULL) { data/ftnchek-3.3.1/ftnchek.c:589: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( (fd = fopen(fullname,"w")) == (FILE *)NULL) { data/ftnchek-3.3.1/ftnchek.c:616:6: [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). fopen(new_ext(main_filename,DEF_VCG_EXTENSION) ,"w"); data/ftnchek-3.3.1/include.c:338: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). return fopen(*fname,mode); data/ftnchek-3.3.1/include.c:358: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( (fp=fopen(*fname,mode)) != (FILE *)NULL) /* Not qualified by a path */ data/ftnchek-3.3.1/include.c:444: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( (fp=fopen(tmpname,mode)) != (FILE *)NULL) { data/ftnchek-3.3.1/intake.c:25:6: [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 linebuf[MAXLINE+1]; data/ftnchek-3.3.1/intrins.c:366:18: [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. PRIVATE unsigned char intrins_hashtab[INTRINS_HASHSZ]; data/ftnchek-3.3.1/keywords.c:106: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 name[sizeof(LONGEST_KEYWORD)]; data/ftnchek-3.3.1/labels.c:362: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 buf[13]; /* holds label enclosed in <> */ data/ftnchek-3.3.1/labels.c:380:12: [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. (void)sprintf(buf, "<%d>:", labtable[k].lab); data/ftnchek-3.3.1/labels.c:491: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 buf[13]; /* holds label enclosed in <> */ data/ftnchek-3.3.1/labels.c:517:12: [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. (void)sprintf(buf, "<%d>", labtable[k].lab); data/ftnchek-3.3.1/labels.c:912: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 detail[25]; data/ftnchek-3.3.1/labels.c:943: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 buf[6]; /* holds bracketed footnote # */ data/ftnchek-3.3.1/labels.c:949: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. (void)sprintf(buf, "[%d]", i); data/ftnchek-3.3.1/loccheck.c:293:7: [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 detail[MAXIDSIZE+MAX_TAG_LEN+6]; /* see sprintf below */ data/ftnchek-3.3.1/makedcls.c:155: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. PRIVATE char stmt_fragment[MAX_STMT]; data/ftnchek-3.3.1/makedcls.c:361: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 begin[72+1+72+1+2+1]; data/ftnchek-3.3.1/makedcls.c:1107: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 digits[sizeof("*18446744073709551616")]; /* big enough for 2^64 */ data/ftnchek-3.3.1/makedcls.c:1138:12: [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. (void)sprintf(digits,"*%d",the_size); data/ftnchek-3.3.1/makehtml.c:165: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. PRIVATE char stmt_fragment[MAX_STMT]; data/ftnchek-3.3.1/makehtml.c:336: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 linein[1024]; data/ftnchek-3.3.1/makehtml.c:344: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 leader_srch[133]; data/ftnchek-3.3.1/makehtml.c:747: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 module_str[256]; data/ftnchek-3.3.1/makehtml.c:748: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 modname[256]; data/ftnchek-3.3.1/makehtml.c:790:14: [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. n = sprintf( module_str, "BLOCK DATA FUNCTION" ); data/ftnchek-3.3.1/makehtml.c:796: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( modname, "BLOCKDATA" ); data/ftnchek-3.3.1/makehtml.c:1433: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 *p, scope_str[128]; data/ftnchek-3.3.1/makehtml.c:1505: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( scope_str, "Local Var" ); data/ftnchek-3.3.1/makehtml.c:1660: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 digits[sizeof("*18446744073709551616")]; /* big enough for 2^64 */ data/ftnchek-3.3.1/makehtml.c:1690:19: [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. (void)sprintf(digits,"*%d",the_size); data/ftnchek-3.3.1/makehtml.c:2196:7: [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( my_ioinfo, io_unit_info, data/ftnchek-3.3.1/makehtml.c:2221:16: [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( &save_info, ioinfo_ptr, sizeof( IO_Unit_Info ) ); data/ftnchek-3.3.1/makehtml.c:2229:16: [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( opcode, " " ); /* Initialize for this ref */ data/ftnchek-3.3.1/message.c:551:12: [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 str[MAX_ULONGTOSTR]; data/ftnchek-3.3.1/message.c:552:11: [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. (void)sprintf(str,"%lu",num); data/ftnchek-3.3.1/options.c:1094: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 env_option_name[ENV_OPTION_NAME_LEN]; data/ftnchek-3.3.1/options.c:1214: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 rc_option_string[MAX_RC_LINE]; data/ftnchek-3.3.1/options.c:1271:11: [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( (fp=fopen(fname,"r")) == (FILE *)NULL) { data/ftnchek-3.3.1/options.c:1275: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( (fp=fopen(fname,"r")) == (FILE *)NULL) { data/ftnchek-3.3.1/options.c:1293:10: [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( (fp=fopen(fname,"r")) == (FILE *)NULL) { data/ftnchek-3.3.1/options.c:1302: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( (fp=fopen(fname,"r")) == (FILE *)NULL) { data/ftnchek-3.3.1/options.c:1621: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 opt_buf[MAX_OPT_LEN+1]; data/ftnchek-3.3.1/pgsymtab.c:273: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 posn[12+3*sizeof(int)+2]; data/ftnchek-3.3.1/pgsymtab.c:274: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. (void)sprintf(posn,"at position %d:",i+1); data/ftnchek-3.3.1/plsymtab.c:193: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 intro[MAXIDSIZE+19]; /* introduction to warning/error message */ data/ftnchek-3.3.1/plsymtab.c:315:6: [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 msgbuf[6+MAX_TAG_LEN+MAXIDSIZE]; /* see sprintf below */ data/ftnchek-3.3.1/prlists.c:480: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 expr_text[MAXEXPRTEXT+2]; /* big enough for 1 extra */ data/ftnchek-3.3.1/prlists.c:517:9: [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. (void)strcpy(expr_text+MAXEXPRTEXT-2,".."); data/ftnchek-3.3.1/project.c: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 sym_has_defn[GLOBSYMTABSZ]; data/ftnchek-3.3.1/project.c:157: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 sym_has_call[GLOBSYMTABSZ]; data/ftnchek-3.3.1/project.c:484: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 buf[MAXNAME+1],*topfilename=NULL; data/ftnchek-3.3.1/project.c:572: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 id_name[MAXNAME+1],module_name[MAXNAME+1],sentinel[6]; data/ftnchek-3.3.1/project.c:573: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 file_name[MAXNAME+1]; data/ftnchek-3.3.1/project.c:574: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 arg_name[MAXNAME+1]; data/ftnchek-3.3.1/project.c:599: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 arg_common_block[MAXNAME+1]; data/ftnchek-3.3.1/project.c:880: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 id_name[MAXNAME+1],module_name[MAXNAME+1]; data/ftnchek-3.3.1/project.c:881: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 file_name[MAXNAME+1]; data/ftnchek-3.3.1/project.c:882: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 var_name[MAXNAME+1]; data/ftnchek-3.3.1/symspace.c:374: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. PRIVATE char onechar_text[2*(MAX_CHAR_CODE+1)]; data/ftnchek-3.3.1/symspace.c:412: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. PRIVATE char tree_text_space[MAXTREETEXT]; data/ftnchek-3.3.1/symtab.c:2009: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 textbuf[25]; data/ftnchek-3.3.1/symtab.c:2023: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 textbuf[256]; data/ftnchek-3.3.1/symtab.c:2032: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 textbuf[256]; data/ftnchek-3.3.1/symtab.c:2041: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 textbuf[256]; data/ftnchek-3.3.1/symtab.c:2598:12: [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_TYPESPEC]; data/ftnchek-3.3.1/symtab.c:2601: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. (void) sprintf(buf+strlen(buf),"*%ld",size); data/ftnchek-3.3.1/symtab.c:2604: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. (void) sprintf(buf+strlen(buf),"(%ld)",len); data/ftnchek-3.3.1/symtab.h:311:1: [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 *implicit_len_text[('Z'-'A'+1)+2]; data/ftnchek-3.3.1/symtab.h:744: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 strspace[STRSPACESZ]; data/ftnchek-3.3.1/symtab.h:773: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 * ptrspace[PTRSPACESZ]; data/ftnchek-3.3.1/test/cmp.c:57:10: [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). fd = fopen(path,mode); data/ftnchek-3.3.1/test/cmp.c:86: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 line1[MAXLINE], line2[MAXLINE]; /* buffers for input */ data/ftnchek-3.3.1/argcheck.c:311: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(sizebuf,"*"); data/ftnchek-3.3.1/argcheck.c:323: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(sizebuf,"*"); data/ftnchek-3.3.1/calltree.c:112: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). len = ( unsigned ) strlen( s ); data/ftnchek-3.3.1/calltree.c:140:52: [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). malloc( ( unsigned ) ( len + ( unsigned ) strlen( ext ) + 1 ) ); data/ftnchek-3.3.1/calltree.c:141:16: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). ( void ) strncpy( newname, s, len ); data/ftnchek-3.3.1/calltree.c:155:70: [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). ( unsigned ) strlen( ext ) data/ftnchek-3.3.1/calltree.c:157:22: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). ( void ) strncpy( newname, s, len ); data/ftnchek-3.3.1/calltree.c:164:22: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). ( void ) strncpy( newname, s, len ); data/ftnchek-3.3.1/calltree.c:171: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). ( unsigned ) strlen( ext ) + data/ftnchek-3.3.1/calltree.c:1202: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(list[j]->link.module->name); data/ftnchek-3.3.1/calltree.c:1209: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(list[j]->name)+1; data/ftnchek-3.3.1/calltree.c:1218: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(list[j]->name); data/ftnchek-3.3.1/comcheck.c:736: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). if( (col += 1+(int)strlen(r_list[i].name)) > 78 ) { data/ftnchek-3.3.1/comcheck.c:738: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). col = 4+(int)strlen(r_list[i].name); data/ftnchek-3.3.1/exprtype.c:1723: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). int n1=strlen(s1), n2=strlen(s2); data/ftnchek-3.3.1/exprtype.c:1723: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). int n1=strlen(s1), n2=strlen(s2); data/ftnchek-3.3.1/fortran.c:2293: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). # define yystrlen strlen data/ftnchek-3.3.1/fortran.c:3319:38: [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). (unsigned)(yyvsp[-1].col_num+strlen(token_name(&yyvsp[-1]))), data/ftnchek-3.3.1/fortran.c:3357: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). (unsigned)(yyvsp[-1].col_num+strlen(token_name(&yyvsp[-1]))), data/ftnchek-3.3.1/fortran.c:3801:35: [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). (unsigned)(yyvsp[-1].col_num+strlen(token_name(&yyvsp[-1]))), data/ftnchek-3.3.1/ftnchek.c:662: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). len=(unsigned)strlen(s); data/ftnchek-3.3.1/ftnchek.c:685:56: [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). newname = (char *) malloc( (unsigned)(len+(unsigned)strlen(ext)+1) ); data/ftnchek-3.3.1/ftnchek.c:686:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(newname,s,len); data/ftnchek-3.3.1/ftnchek.c:695: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). (unsigned)strlen(ext)+1) ); data/ftnchek-3.3.1/ftnchek.c:696:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(newname,s,len); data/ftnchek-3.3.1/ftnchek.c:701:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy(newname,s,len); data/ftnchek-3.3.1/ftnchek.c:707: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). (unsigned)strlen(ext)+1) ); data/ftnchek-3.3.1/ftnchek.c:757:13: [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). ext_len = strlen(ext); data/ftnchek-3.3.1/ftnchek.c:765: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). name_len=strlen(name); /* distance to the null */ data/ftnchek-3.3.1/include.c:198:13: [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). fname[strlen(fname)-strlen("/nolist")] = '\0'; /* trim off qualifier */ data/ftnchek-3.3.1/include.c:198: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). fname[strlen(fname)-strlen("/nolist")] = '\0'; /* trim off qualifier */ data/ftnchek-3.3.1/include.c:202:13: [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). fname[strlen(fname)-strlen("/list")] = '\0'; /* trim off qualifier */ data/ftnchek-3.3.1/include.c:202: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). fname[strlen(fname)-strlen("/list")] = '\0'; /* trim off qualifier */ data/ftnchek-3.3.1/include.c:374:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(local_path,current_filename,path_end-current_filename); data/ftnchek-3.3.1/include.c:425:35: [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( (tmpname = (char *)malloc(strlen(inc_path)+strlen(*fname)+2)) data/ftnchek-3.3.1/include.c:425:52: [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( (tmpname = (char *)malloc(strlen(inc_path)+strlen(*fname)+2)) data/ftnchek-3.3.1/include.c:435: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). if(tmpname[strlen(tmpname)-1] != '/') data/ftnchek-3.3.1/include.c:436:13: [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. (void)strcat(tmpname,"/"); data/ftnchek-3.3.1/include.c:439: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). if(tmpname[strlen(tmpname)-1] != '\\') data/ftnchek-3.3.1/include.c:440:13: [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. (void)strcat(tmpname,"\\"); data/ftnchek-3.3.1/intake.c:33: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). line_len = strlen(linebuf); /* this counts the \n */ data/ftnchek-3.3.1/intake.c:40:21: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( (c = getc(fd)) != ENDL && c != EOF ) data/ftnchek-3.3.1/intake.c:133:13: [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). last_i = strlen(p->line)-1; data/ftnchek-3.3.1/intrins.c:533:13: [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 n = strlen(s); data/ftnchek-3.3.1/loccheck.c:274: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(list[i]->name); data/ftnchek-3.3.1/makedcls.c:369: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). len_base_curr_filename = strlen(base_curr_filename); data/ftnchek-3.3.1/makedcls.c:841: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). need = (int)strlen(symt->name); data/ftnchek-3.3.1/makedcls.c:911: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). need = strlen(get_parameter_value(symt)); data/ftnchek-3.3.1/makedcls.c:1021: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). need = (int)strlen(sym_list[i]->name); data/ftnchek-3.3.1/makedcls.c:1025: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). need += strlen(get_dimension_list(sym_list[i])); data/ftnchek-3.3.1/makedcls.c:1132: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). column += strlen(size_expression); data/ftnchek-3.3.1/makedcls.c:1140: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). column += strlen(digits); data/ftnchek-3.3.1/makedcls.c:1401: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 ((p[0] != 'N') || (strlen(p) != 6)) data/ftnchek-3.3.1/makehtml.c:234: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). for ( n = 0; n < (len=strlen( str ) ); ) data/ftnchek-3.3.1/makehtml.c:300: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( str ) - 1; data/ftnchek-3.3.1/makehtml.c:479: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). buffcount += strlen( linein ) + sizeof( buff_end ); data/ftnchek-3.3.1/makehtml.c:503: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). pbuf = buffer + strlen( buffer ) - 1; data/ftnchek-3.3.1/makehtml.c:516: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). strlen( &buffer[min_leader] )+1 ); data/ftnchek-3.3.1/makehtml.c:528: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). strlen( &pbuf[min_leader] ) + 1); data/ftnchek-3.3.1/makehtml.c:1222: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). need = (int)strlen(symt->name); data/ftnchek-3.3.1/makehtml.c:1322: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 ( strlen(*pheader) ) data/ftnchek-3.3.1/makehtml.c:1341: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). need = (int)strlen(sym_list[i]->name); data/ftnchek-3.3.1/makehtml.c:1348: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). need += strlen(get_dimension_list(sym_list[i])); data/ftnchek-3.3.1/makehtml.c:1447: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). if ( strlen( *pheader ) ) data/ftnchek-3.3.1/makehtml.c:1493:20: [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). column += strlen( cur_sym->name ); data/ftnchek-3.3.1/makehtml.c:1571: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). if ( strlen( *pheader ) ) data/ftnchek-3.3.1/makehtml.c:1585: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). need = (int)strlen(sym_list[i]->name); data/ftnchek-3.3.1/makehtml.c:1592:20: [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). need += strlen(get_dimension_list(sym_list[i])); data/ftnchek-3.3.1/makehtml.c:1684: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). column += strlen(size_expression); data/ftnchek-3.3.1/makehtml.c:1692: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). column += strlen(digits); data/ftnchek-3.3.1/makehtml.c:1927: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 ((p[0] != 'N') || (strlen(p) != 6)) data/ftnchek-3.3.1/message.c:302: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). errmsg_col += 2+(int)strlen(filename); data/ftnchek-3.3.1/message.c:369: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). errmsg_col += strlen(tag); data/ftnchek-3.3.1/message.c:377:49: [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). errmsg_col += 11+NUM_DIGITS(lineno)+(unsigned)strlen(tag); data/ftnchek-3.3.1/message.c:385:48: [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). errmsg_col += 9+NUM_DIGITS(lineno)+(unsigned)strlen(tag); data/ftnchek-3.3.1/message.c:400: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). +(unsigned)strlen(tag); data/ftnchek-3.3.1/message.c:407:49: [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). errmsg_col += 11+NUM_DIGITS(lineno)+(unsigned)strlen(tag); data/ftnchek-3.3.1/message.c:423: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). errmsg_col += 6+(unsigned)strlen(filename); data/ftnchek-3.3.1/options.c:1106:28: [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). checklen = MAX(checklen,strlen(switchopt[i].name)); data/ftnchek-3.3.1/options.c:1109:28: [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). checklen = MAX(checklen,strlen(setting[i].name)); data/ftnchek-3.3.1/options.c:1112:28: [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). checklen = MAX(checklen,strlen(strsetting[i].name)); data/ftnchek-3.3.1/options.c:1163: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). || strncasecmp(value,"1",strlen(value)) == 0 data/ftnchek-3.3.1/options.c:1164:31: [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). || strncasecmp(value,"yes",strlen(value)) == 0 data/ftnchek-3.3.1/options.c:1168: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). else if(strncasecmp(value,"no",strlen(value)) == 0) { data/ftnchek-3.3.1/options.c:1253:24: [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). (homedir!=NULL?strlen(homedir): data/ftnchek-3.3.1/options.c:1255:4: [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(SPECIAL_HOMEDIR) data/ftnchek-3.3.1/options.c:1289:8: [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. (void)strcat(fname,"/"); data/ftnchek-3.3.1/options.c:1299:10: [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. (void)strcat(fname,"/"); data/ftnchek-3.3.1/options.c:1466:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void)strncpy( *(strsetting[i].strvalue), data/ftnchek-3.3.1/options.c:1711:24: [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(strncmp(s,"no-",strlen("no-")) == 0) { data/ftnchek-3.3.1/options.c:1712: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). offset = strlen("no-"); data/ftnchek-3.3.1/plsymtab.c:260: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(sym_list[i]->name);/* len=actual length of name */ data/ftnchek-3.3.1/plsymtab.c:833: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). if(strlen(*tag) > MAX_TAG_LEN) { data/ftnchek-3.3.1/prlocsym.c:379: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). if(strlen(loc_symtab[i].name) > (unsigned)6) data/ftnchek-3.3.1/project.c:460:9: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. fscanf(fd,"%127s",STR)) data/ftnchek-3.3.1/project.c:462:11: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. fscanf(fd,"%127s",STR)==1)? READ_OK:READ_ERROR)) data/ftnchek-3.3.1/project.c:463:63: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define READ_ARG(LEADER,STR) ((void)((fscanf(fd,LEADER)==0 && fgetc(fd)==' ' &&\ data/ftnchek-3.3.1/project.c:469:35: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define NEXTLINE {int c;while( (c=fgetc(fd)) != EOF && c != '\n') continue;\ data/ftnchek-3.3.1/project.c:658:13: [1] (buffer) fscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. while( fscanf(fd,"%5s",sentinel), data/ftnchek-3.3.1/project.c:1047:12: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while( (c=getc(fd)) != '\n' ) { data/ftnchek-3.3.1/symspace.c:208:20: [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). unsigned count = strlen(s) + 1;/* no. of chars needed including final nul */ data/ftnchek-3.3.1/symspace.c:237: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 count = strlen(s) + 1; /* No. of chars needed including final nul */ data/ftnchek-3.3.1/symtab.c:2599:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf,type_name[t],4); buf[4] = '\0'; data/ftnchek-3.3.1/symtab.c:2601: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). (void) sprintf(buf+strlen(buf),"*%ld",size); data/ftnchek-3.3.1/symtab.c:2604: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). (void) sprintf(buf+strlen(buf),"(%ld)",len); ANALYSIS SUMMARY: Hits = 291 Lines analyzed = 38871 in approximately 1.16 seconds (33414 lines/second) Physical Source Lines of Code (SLOC) = 28656 Hits@level = [0] 537 [1] 105 [2] 97 [3] 26 [4] 63 [5] 0 Hits@level+ = [0+] 828 [1+] 291 [2+] 186 [3+] 89 [4+] 63 [5+] 0 Hits/KSLOC@level+ = [0+] 28.8945 [1+] 10.1549 [2+] 6.49079 [3+] 3.10581 [4+] 2.19849 [5+] 0 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.