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/ltrsift-1.0.2/src/default_style.c Examining data/ltrsift-1.0.2/src/default_style.h Examining data/ltrsift-1.0.2/src/error.c Examining data/ltrsift-1.0.2/src/error.h Examining data/ltrsift-1.0.2/src/gtk_blastn_params.c Examining data/ltrsift-1.0.2/src/gtk_blastn_params.h Examining data/ltrsift-1.0.2/src/gtk_blastn_params_refseq.c Examining data/ltrsift-1.0.2/src/gtk_blastn_params_refseq.h Examining data/ltrsift-1.0.2/src/gtk_label_close.c Examining data/ltrsift-1.0.2/src/gtk_label_close.h Examining data/ltrsift-1.0.2/src/gtk_ltr_assistant.c Examining data/ltrsift-1.0.2/src/gtk_ltr_assistant.h Examining data/ltrsift-1.0.2/src/gtk_ltr_families.c Examining data/ltrsift-1.0.2/src/gtk_ltr_families.h Examining data/ltrsift-1.0.2/src/gtk_ltr_filter.c Examining data/ltrsift-1.0.2/src/gtk_ltr_filter.h Examining data/ltrsift-1.0.2/src/gtk_project_settings.c Examining data/ltrsift-1.0.2/src/gtk_project_settings.h Examining data/ltrsift-1.0.2/src/ltrsift.c Examining data/ltrsift-1.0.2/src/ltrsift.h Examining data/ltrsift-1.0.2/src/ltrsift_encode.c Examining data/ltrsift-1.0.2/src/menubar.h Examining data/ltrsift-1.0.2/src/preprocess_stream.c Examining data/ltrsift-1.0.2/src/preprocess_stream.h Examining data/ltrsift-1.0.2/src/preprocess_visitor.c Examining data/ltrsift-1.0.2/src/preprocess_visitor.h Examining data/ltrsift-1.0.2/src/project_wizard.c Examining data/ltrsift-1.0.2/src/project_wizard.h Examining data/ltrsift-1.0.2/src/script_filter_stream.c Examining data/ltrsift-1.0.2/src/script_filter_stream.h Examining data/ltrsift-1.0.2/src/statusbar.c Examining data/ltrsift-1.0.2/src/statusbar.h Examining data/ltrsift-1.0.2/src/support.c Examining data/ltrsift-1.0.2/src/support.h Examining data/ltrsift-1.0.2/src/menubar.c Examining data/ltrsift-1.0.2/src/message_strings.h FINAL RESULTS: data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:853:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -x %d", last_call, xgapped); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:855:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -z %d", last_call, xfinal); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:857:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -y %d", last_call, xgapless); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:859:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -e %d", last_call, mscoregapped); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:861:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -d %d", last_call, mscoregapless); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:864:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -a %d", last_call, gapopen); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:866:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -b %d", last_call, gapextend); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:868:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -r %d", last_call, matchscore); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:870:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -q %d", last_call, mismatchcost); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:872:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s -k %d", last_call, stepsize); data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:889:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(last_call, "%s %s", last_call, morelast); data/ltrsift-1.0.2/src/gtk_ltr_families.c:1139:16: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_families.c:1504:45: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_families.c:2179:41: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_families.c:2293:45: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_families.c:2337:41: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_filter.c:421:63: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(fc), g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_filter.c:742:9: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/ltrsift-1.0.2/src/gtk_ltr_filter.c:871:41: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/ltrsift.c:318:26: [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. ltrgui->style_file = getenv(LTRSIFT_STYLE_ENV); data/ltrsift-1.0.2/src/menubar.c:906:41: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/menubar.c:1028:41: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/menubar.c:1369:45: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/menubar.c:1406:41: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. g_get_home_dir()); data/ltrsift-1.0.2/src/gtk_ltr_families.c:972: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_oldname, data/ltrsift-1.0.2/src/gtk_ltr_families.c:2566: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 tmp_curname[BUFSIZ]; data/ltrsift-1.0.2/src/gtk_ltr_families.c:3359: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. char hex[8]; data/ltrsift-1.0.2/src/gtk_ltr_families.c:4242: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 tmp_name[BUFSIZ]; data/ltrsift-1.0.2/src/support.c:537: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 *buffer, header[BUFSIZ]; data/ltrsift-1.0.2/src/support.h:50:12: [2] (misc) open: 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). open, data/ltrsift-1.0.2/src/gtk_ltr_assistant.c:669:40: [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). gchar *tmp = g_strndup(filename, strlen(filename) - 4); data/ltrsift-1.0.2/src/gtk_ltr_families.c:1513:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp = g_strndup(tmpname, strlen(tmpname) - strlen(ESQ_PATTERN)); data/ltrsift-1.0.2/src/gtk_ltr_families.c:1513: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). tmp = g_strndup(tmpname, strlen(tmpname) - strlen(ESQ_PATTERN)); data/ltrsift-1.0.2/src/gtk_ltr_families.c:2303:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp = g_strndup(tmpname, strlen(tmpname) - strlen(ESQ_PATTERN)); data/ltrsift-1.0.2/src/gtk_ltr_families.c:2303: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). tmp = g_strndup(tmpname, strlen(tmpname) - strlen(ESQ_PATTERN)); data/ltrsift-1.0.2/src/gtk_project_settings.c:555: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). tmp = g_strndup(filename, strlen(filename) - strlen(ESQ_PATTERN)); data/ltrsift-1.0.2/src/gtk_project_settings.c:555:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp = g_strndup(filename, strlen(filename) - strlen(ESQ_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:683: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). strlen(threaddata->filename) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:683:60: [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(threaddata->filename) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:865: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). strlen(projectfile) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:865: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). strlen(projectfile) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:958: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). strlen(threaddata->filename) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:958:58: [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(threaddata->filename) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:992: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). strlen(threaddata->filename) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:992:58: [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(threaddata->filename) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/menubar.c:1378:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tmp = g_strndup(tmpname, strlen(tmpname) - 4); data/ltrsift-1.0.2/src/project_wizard.c:245: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). strlen(tmp_pfile) - strlen(SQLITE_PATTERN)); data/ltrsift-1.0.2/src/project_wizard.c:245:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(tmp_pfile) - strlen(SQLITE_PATTERN)); ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 16372 in approximately 0.46 seconds (35763 lines/second) Physical Source Lines of Code (SLOC) = 14200 Hits@level = [0] 16 [1] 18 [2] 6 [3] 13 [4] 11 [5] 0 Hits@level+ = [0+] 64 [1+] 48 [2+] 30 [3+] 24 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 4.50704 [1+] 3.38028 [2+] 2.11268 [3+] 1.69014 [4+] 0.774648 [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.