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/sumaclust-1.0.36+ds/mtcompare_sumaclust.h Examining data/sumaclust-1.0.36+ds/sumaclust.h Examining data/sumaclust-1.0.36+ds/mtcompare_sumaclust.c Examining data/sumaclust-1.0.36+ds/sumaclust.c Parsing failed to find end of parameter list; semicolon terminated it in (stderr, static void ExitUsage(stat) int stat; { PP "usage: sumaclust [-l|L|a|n|r|d|e|o|g|f] [-t threshold_value] [-s sorting_key] [-R maximum_ratio] [-p number_of_threads]\n"); FINAL RESULTS: data/sumaclust-1.0.36+ds/sumaclust.c:33:12: [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 PP fprintf(stdout, data/sumaclust-1.0.36+ds/sumaclust.c:89:12: [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 PP fprintf(stderr, data/sumaclust-1.0.36+ds/sumaclust.c:398:7: [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. fprintf(biomFile, (*seq)->columns_BIOM); data/sumaclust-1.0.36+ds/sumaclust.c:429: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((*seq)->line_OTU_table, (*seq)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:503:7: [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. fprintf(OTUtableFile, (*seq)->line_OTU_table); data/sumaclust-1.0.36+ds/sumaclust.c:537:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(cluster_v, (*center)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:894:4: [4] (buffer) sscanf: 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. sscanf(optarg, "%s", sort); data/sumaclust-1.0.36+ds/sumaclust.c:913:4: [4] (buffer) sscanf: 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. sscanf(optarg, "%s", biomFile_name); data/sumaclust-1.0.36+ds/sumaclust.c:920:4: [4] (buffer) sscanf: 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. sscanf(optarg, "%s", OTUtableFile_name); data/sumaclust-1.0.36+ds/sumaclust.c:933:4: [4] (buffer) sscanf: 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. sscanf(optarg, "%s", FASTA_file_name); data/sumaclust-1.0.36+ds/sumaclust.c:821:17: [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 ((carg = getopt(argc, argv, "hlLanrdet:p:s:ogB:O:R:fF:")) != -1) { data/sumaclust-1.0.36+ds/sumaclust.c:213: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_date[20]; data/sumaclust-1.0.36+ds/sumaclust.c:230: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). biomFile = fopen(biomFile_name, "w"); data/sumaclust-1.0.36+ds/sumaclust.c:249:8: [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((*seq)->columns_BIOM, "{\"id\": \""); data/sumaclust-1.0.36+ds/sumaclust.c:256:8: [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((*seq)->columns_BIOM, ",{\"id\": \""); data/sumaclust-1.0.36+ds/sumaclust.c:259: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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - id_len - buffer_col_rows_2 - 1, (*seq)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:260: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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - buffer_col_rows_2 - 1, "\", \"metadata\": null}", buffer_col_rows_2+1); data/sumaclust-1.0.36+ds/sumaclust.c:272:9: [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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - buffer_col_rows - id_len - 1, ",{\"id\": \"", buffer_col_rows_1); data/sumaclust-1.0.36+ds/sumaclust.c:273:9: [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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - id_len - buffer_col_rows_2 - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:274:9: [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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - buffer_col_rows_2 - 1, "\", \"metadata\": null}", buffer_col_rows_2+1); data/sumaclust-1.0.36+ds/sumaclust.c:284:9: [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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - buffer_col_rows - id_len - 1, ",{\"id\": \"", buffer_col_rows_1); data/sumaclust-1.0.36+ds/sumaclust.c:285:9: [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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - id_len - buffer_col_rows_2 - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:286:9: [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((*seq)->columns_BIOM + (*seq)->columns_BIOM_size - buffer_col_rows_2 - 1, "\", \"metadata\": null}", buffer_col_rows_2+1); data/sumaclust-1.0.36+ds/sumaclust.c:302:4: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - buffer_col_rows - id_len - 1, ",{\"id\": \"", buffer_col_rows_1); data/sumaclust-1.0.36+ds/sumaclust.c:303:4: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - id_len - buffer_col_rows_2 - 1, (*seq)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:304:4: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - buffer_col_rows_2 - 1, "\", \"metadata\": null}", buffer_col_rows_2+1); data/sumaclust-1.0.36+ds/sumaclust.c:316:6: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - buffer_col_rows - id_len - 1, ",{\"id\": \"", buffer_col_rows_1); data/sumaclust-1.0.36+ds/sumaclust.c:317:6: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - id_len - buffer_col_rows_2 - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:318:6: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - buffer_col_rows_2 - 1, "\", \"metadata\": null}", buffer_col_rows_2+1); data/sumaclust-1.0.36+ds/sumaclust.c:329:6: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - buffer_col_rows - id_len - 1, ",{\"id\": \"", buffer_col_rows_1); data/sumaclust-1.0.36+ds/sumaclust.c:330:6: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - id_len - buffer_col_rows_2 - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:331:6: [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((*c)->columns_BIOM + (*c)->columns_BIOM_size - buffer_col_rows_2 - 1, "\", \"metadata\": null}", buffer_col_rows_2+1); data/sumaclust-1.0.36+ds/sumaclust.c:414:17: [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). OTUtableFile = fopen(OTUtableFile_name, "w"); data/sumaclust-1.0.36+ds/sumaclust.c:430: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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - id_len - 2, "\t", 1); data/sumaclust-1.0.36+ds/sumaclust.c:431: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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - id_len - 1, (*seq)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:432: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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - 1, "\0", 1); data/sumaclust-1.0.36+ds/sumaclust.c:442:9: [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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - id_len - 2, "\t", 1); data/sumaclust-1.0.36+ds/sumaclust.c:443:9: [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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - id_len - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:444:9: [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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - 1, "\0", 1); data/sumaclust-1.0.36+ds/sumaclust.c:453:9: [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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - id_len - 2, "\t", 1); data/sumaclust-1.0.36+ds/sumaclust.c:454:9: [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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - id_len - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:455:9: [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((*seq)->line_OTU_table + (*seq)->line_OTU_table_size - 1, "\0", 1); data/sumaclust-1.0.36+ds/sumaclust.c:465: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((*c)->line_OTU_table + (*c)->line_OTU_table_size - id_len - 2, "\t", 1); data/sumaclust-1.0.36+ds/sumaclust.c:466: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((*c)->line_OTU_table + (*c)->line_OTU_table_size - id_len - 1, (*seq)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:467: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((*c)->line_OTU_table + (*c)->line_OTU_table_size - 1, "\0", 1); data/sumaclust-1.0.36+ds/sumaclust.c:477:6: [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((*c)->line_OTU_table + (*c)->line_OTU_table_size - id_len - 2, "\t", 1); data/sumaclust-1.0.36+ds/sumaclust.c:478:6: [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((*c)->line_OTU_table + (*c)->line_OTU_table_size - id_len - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:479:6: [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((*c)->line_OTU_table + (*c)->line_OTU_table_size - 1, "\0", 1); data/sumaclust-1.0.36+ds/sumaclust.c:488:6: [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((*c)->line_OTU_table + (*c)->line_OTU_table_size - id_len - 2, "\t", 1); data/sumaclust-1.0.36+ds/sumaclust.c:489:6: [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((*c)->line_OTU_table + (*c)->line_OTU_table_size - id_len - 1, (*(seq)+j)->accession_id, id_len); data/sumaclust-1.0.36+ds/sumaclust.c:490:6: [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((*c)->line_OTU_table + (*c)->line_OTU_table_size - 1, "\0", 1); data/sumaclust-1.0.36+ds/sumaclust.c:528:2: [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(score_n, "cluster_score"); data/sumaclust-1.0.36+ds/sumaclust.c:529:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(score_v,"%f", score); data/sumaclust-1.0.36+ds/sumaclust.c:536:2: [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(cluster_n, "cluster"); data/sumaclust-1.0.36+ds/sumaclust.c:540:2: [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(center_n, "cluster_center"); data/sumaclust-1.0.36+ds/sumaclust.c:542:2: [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(center_true, "True"); data/sumaclust-1.0.36+ds/sumaclust.c:544:2: [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(center_false, "False"); data/sumaclust-1.0.36+ds/sumaclust.c:768:3: [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(cluster_weight_n, "cluster_weight"); data/sumaclust-1.0.36+ds/sumaclust.c:769:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(cluster_weight_v,"%d", cluster_weight); data/sumaclust-1.0.36+ds/sumaclust.c:814:2: [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(sort, "count"); data/sumaclust-1.0.36+ds/sumaclust.c:1042:19: [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). FASTA_output = fopen(FASTA_file_name, "w"); data/sumaclust-1.0.36+ds/sumaclust.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). id_len = strlen((*seq)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:266: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:278: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:296: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). id_len = strlen((*seq)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:310: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:323: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:421: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). id_len = strlen((*seq)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:438: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:449: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:473: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:484: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). id_len = strlen((*(seq)+j)->accession_id); data/sumaclust-1.0.36+ds/sumaclust.c:531: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). id_size = strlen((*center)->accession_id); ANALYSIS SUMMARY: Hits = 73 Lines analyzed = 1465 in approximately 0.07 seconds (20529 lines/second) Physical Source Lines of Code (SLOC) = 1110 Hits@level = [0] 46 [1] 12 [2] 50 [3] 1 [4] 10 [5] 0 Hits@level+ = [0+] 119 [1+] 73 [2+] 61 [3+] 11 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 107.207 [1+] 65.7658 [2+] 54.955 [3+] 9.90991 [4+] 9.00901 [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.