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/xml2-0.5/2csv.c Examining data/xml2-0.5/2xml.c Examining data/xml2-0.5/csv2.c Examining data/xml2-0.5/xml2.c FINAL RESULTS: data/xml2-0.5/xml2.c:141: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(leaf->name,attr ? "@" : ""); data/xml2-0.5/xml2.c:142:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(leaf->name,name); data/xml2-0.5/xml2.c:215:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr,msg,ap); data/xml2-0.5/2csv.c:39:23: [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 (EOF != (arg = getopt(argc,argv,"q:d:"))) switch (arg) { data/xml2-0.5/csv2.c:93:23: [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 (EOF != (arg = getopt(argc,argv,"fq:d:"))) switch (arg) { data/xml2-0.5/csv2.c:40:4: [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(ptr,"field"); data/xml2-0.5/xml2.c:168:2: [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(content_buffer + content_len,ch,len); data/xml2-0.5/xml2.c:236: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 buffer[4096]; data/xml2-0.5/2csv.c:19: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). if (strcspn(vec[i],d) == strlen(vec[i])) data/xml2-0.5/2csv.c:48: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). record_len = strlen((record = argv[0])); data/xml2-0.5/2csv.c:54: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). field_len[i] = strlen(argv[i]); data/xml2-0.5/2csv.c:62: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(buffer + len); data/xml2-0.5/2xml.c:224:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(0,len + buffer,alloc - len)) > 0) { data/xml2-0.5/csv2.c:108:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((num = read(0,len + buffer,alloc - len)) > 0) { data/xml2-0.5/xml2.c:140: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). leaf->name = malloc(2 + strlen(name)); data/xml2-0.5/xml2.c:182: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). content(atts[1],atts[1] ? strlen(atts[1]) : 0,0); data/xml2-0.5/xml2.c:206: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). content(value,strlen(value),1); data/xml2-0.5/xml2.c:264:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (0 < (num = read(0,buffer,sizeof(buffer))) ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 735 in approximately 0.03 seconds (27100 lines/second) Physical Source Lines of Code (SLOC) = 595 Hits@level = [0] 5 [1] 10 [2] 3 [3] 2 [4] 3 [5] 0 Hits@level+ = [0+] 23 [1+] 18 [2+] 8 [3+] 5 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 38.6555 [1+] 30.2521 [2+] 13.4454 [3+] 8.40336 [4+] 5.04202 [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.