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/csv2latex-0.22/version.h Examining data/csv2latex-0.22/csv2latex.c FINAL RESULTS: data/csv2latex-0.22/csv2latex.c:188: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). strcpy(conf->clrrow, optarg); data/csv2latex-0.22/csv2latex.c:406:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(tmp, (conf->hlines ? "\\\\\n\\hline" : "\\\\\n")); data/csv2latex-0.22/csv2latex.c:407:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(headerrow, tmp); data/csv2latex-0.22/csv2latex.c:465:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(headerrow, tmp); data/csv2latex-0.22/csv2latex.c:492: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). strcat(headerrow, tmp); data/csv2latex-0.22/csv2latex.c:503: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). strcat(headerrow, tmp); data/csv2latex-0.22/csv2latex.c:519:6: [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(headerrow, tmp); data/csv2latex-0.22/csv2latex.c:126: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 ((opt = getopt (argc, argv, "hvgnxteyza?b:l:p:s:c:r:f:")) != EOF) { data/csv2latex-0.22/csv2latex.c:128:16: [3] (buffer) getopt_long: 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 ((opt = getopt_long (argc, argv, "hvgnxteyza?b:l:p:s:c:r:f:", long_options, &longopt_index)) > 0) { data/csv2latex-0.22/csv2latex.c:152:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). conf->lines = atoi(optarg); data/csv2latex-0.22/csv2latex.c:197:13: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). tmp = atoi(optarg); data/csv2latex-0.22/csv2latex.c:219:20: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). conf->font = atoi(optarg); data/csv2latex-0.22/csv2latex.c:360: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 headerrow[1000]; data/csv2latex-0.22/csv2latex.c:405: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 tmp[12]; data/csv2latex-0.22/csv2latex.c:462: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 tmp[2]; data/csv2latex-0.22/csv2latex.c:490: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. char tmp[17]; data/csv2latex-0.22/csv2latex.c:491:10: [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(tmp, "\\textbackslash{}"); data/csv2latex-0.22/csv2latex.c:499: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. char tmp[3]; data/csv2latex-0.22/csv2latex.c:516: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 tmp[2]; data/csv2latex-0.22/csv2latex.c:649:8: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fp = tmpfile(); data/csv2latex-0.22/csv2latex.c:655:8: [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). fp = fopen(argv[optind], "r"); data/csv2latex-0.22/csv2latex.c:187:36: [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). conf->clrrow = (char*)malloc(strlen(optarg)+1); data/csv2latex-0.22/csv2latex.c:235:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). token = getc(in); /* first char is block delimiter */ data/csv2latex-0.22/csv2latex.c:245:19: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((token = getc(in)) != conf->block && data/csv2latex-0.22/csv2latex.c:251:16: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). conf->sep = getc(in); data/csv2latex-0.22/csv2latex.c:262:28: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!ispunct((token = getc(in))) && data/csv2latex-0.22/csv2latex.c:292:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). token = getc(in); data/csv2latex-0.22/csv2latex.c:378:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). token = getc(in); data/csv2latex-0.22/csv2latex.c:641: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). conf->tex->size = strlen(conf->tex->tab); data/csv2latex-0.22/csv2latex.c:650:22: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (EOF != (c = getc(stdin))) { ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 688 in approximately 0.06 seconds (11712 lines/second) Physical Source Lines of Code (SLOC) = 575 Hits@level = [0] 69 [1] 9 [2] 12 [3] 2 [4] 7 [5] 0 Hits@level+ = [0+] 99 [1+] 30 [2+] 21 [3+] 9 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 172.174 [1+] 52.1739 [2+] 36.5217 [3+] 15.6522 [4+] 12.1739 [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.