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/parcellite-1.2.1/src/keybinder.c Examining data/parcellite-1.2.1/src/daemon.c Examining data/parcellite-1.2.1/src/eggaccelerators.h Examining data/parcellite-1.2.1/src/daemon.h Examining data/parcellite-1.2.1/src/keybinder.h Examining data/parcellite-1.2.1/src/attr_list.h Examining data/parcellite-1.2.1/src/eggaccelerators.c Examining data/parcellite-1.2.1/src/main.c Examining data/parcellite-1.2.1/src/utils.h Examining data/parcellite-1.2.1/src/preferences.h Examining data/parcellite-1.2.1/src/parcellite-i18n.h Examining data/parcellite-1.2.1/src/history.h Examining data/parcellite-1.2.1/src/history.c Examining data/parcellite-1.2.1/src/preferences.c Examining data/parcellite-1.2.1/src/parcellite.h Examining data/parcellite-1.2.1/src/main.h Examining data/parcellite-1.2.1/src/attr_list.c Examining data/parcellite-1.2.1/src/utils.c FINAL RESULTS: data/parcellite-1.2.1/src/eggaccelerators.c:370: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 (accelerator + l, text_release); data/parcellite-1.2.1/src/eggaccelerators.c:375: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 (accelerator + l, text_shift); data/parcellite-1.2.1/src/eggaccelerators.c:380: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 (accelerator + l, text_control); data/parcellite-1.2.1/src/eggaccelerators.c:385: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 (accelerator + l, text_mod1); data/parcellite-1.2.1/src/eggaccelerators.c:390: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 (accelerator + l, text_mod2); data/parcellite-1.2.1/src/eggaccelerators.c:395: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 (accelerator + l, text_mod3); data/parcellite-1.2.1/src/eggaccelerators.c:400: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 (accelerator + l, text_mod4); data/parcellite-1.2.1/src/eggaccelerators.c:405: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 (accelerator + l, text_mod5); data/parcellite-1.2.1/src/eggaccelerators.c:410: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 (accelerator + l, text_meta); data/parcellite-1.2.1/src/eggaccelerators.c:415: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 (accelerator + l, text_hyper); data/parcellite-1.2.1/src/eggaccelerators.c:420: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 (accelerator + l, text_super); data/parcellite-1.2.1/src/eggaccelerators.c:424: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 (accelerator + l, keyval_name); data/parcellite-1.2.1/src/main.c:677:6: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if(system((gchar*)command)) data/parcellite-1.2.1/src/preferences.c:221:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cmd,"/bin/sh -c 'which %s'>/dev/null\n",tool_flags[i].name); data/parcellite-1.2.1/src/utils.c:99:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if(0 != access(rc_file, R_OK)){/**doesn't exist */ data/parcellite-1.2.1/src/utils.c:106:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if(0 == access(sysrc, F_OK)){/**exists */ data/parcellite-1.2.1/src/utils.c:306:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if(0 != access(envf, R_OK)){/**doesn't exist, or not our process */ data/parcellite-1.2.1/src/utils.c:608:10: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if(0 == access(f,F_OK) ) data/parcellite-1.2.1/src/history.c:557:70: [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 (dialog), g_get_home_dir()); data/parcellite-1.2.1/src/utils.c:248:25: [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. username = (gchar *)g_get_home_dir (); data/parcellite-1.2.1/src/history.c:72: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). FILE* history_file = fopen(history_path, "rb"); data/parcellite-1.2.1/src/history.c:117: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). FILE* history_file = fopen(history_path, "wb"); data/parcellite-1.2.1/src/history.c:152:3: [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(magic,history_magics[i],strlen(history_magics[i])); data/parcellite-1.2.1/src/history.c:178: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). FILE* history_file = fopen(history_path, "rb"); data/parcellite-1.2.1/src/history.c:269: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). FILE* history_file = fopen(history_path, "wb"); data/parcellite-1.2.1/src/history.c:279:3: [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(magic,history_magics[HISTORY_VERSION-1],strlen(history_magics[HISTORY_VERSION-1])); data/parcellite-1.2.1/src/history.c:325: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(c->text,data,len); data/parcellite-1.2.1/src/history.c:517: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). FILE* fp = fopen(path, "w"); data/parcellite-1.2.1/src/main.c:1234: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). FILE* actions_file = fopen(path, "rb"); data/parcellite-1.2.1/src/preferences.c:731: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). FILE* actions_file = fopen(path, "rb"); data/parcellite-1.2.1/src/preferences.c:771: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). FILE* actions_file = fopen(path, "wb"); data/parcellite-1.2.1/src/utils.c:227: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 path[255]; data/parcellite-1.2.1/src/utils.c:500: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[PATH_MAX]; data/parcellite-1.2.1/src/utils.c:518:14: [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(buf, "r"))) { data/parcellite-1.2.1/src/utils.c:649:5: [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). fd=open(path,flg,mode); data/parcellite-1.2.1/src/eggaccelerators.c:220:9: [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 (accelerator); data/parcellite-1.2.1/src/eggaccelerators.c:362: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). l += strlen (keyval_name); data/parcellite-1.2.1/src/history.c:152: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). memcpy(magic,history_magics[i],strlen(history_magics[i])); data/parcellite-1.2.1/src/history.c:279: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). memcpy(magic,history_magics[HISTORY_VERSION-1],strlen(history_magics[HISTORY_VERSION-1])); data/parcellite-1.2.1/src/history.c:388:46: [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(NULL == (c=new_clip_item(CLIP_TYPE_TEXT,strlen(item),item)) ) data/parcellite-1.2.1/src/main.c:204:7: [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(ntext);/*g_utf8_strlen(ntext,-1); */ data/parcellite-1.2.1/src/main.c:222: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(ntext) != len) data/parcellite-1.2.1/src/main.c:403: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). validate_utf8_text(intext,strlen(intext)); data/parcellite-1.2.1/src/main.c:423: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). if(0 == validate_utf8_text(changed,strlen(changed))) data/parcellite-1.2.1/src/main.c:834:9: [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). slen=strlen(new_clipboard_text); data/parcellite-1.2.1/src/main.c:1546: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). slen=strlen(l); data/parcellite-1.2.1/src/main.c:2366: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). write_fifo(fifo,FIFO_MODE_PRI,opts->leftovers,strlen(opts->leftovers)); data/parcellite-1.2.1/src/main.c:2372:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); data/parcellite-1.2.1/src/main.c:2387: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). write_fifo(fifo,FIFO_MODE_CLI,opts->leftovers,strlen(opts->leftovers)); data/parcellite-1.2.1/src/main.c:2391:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); data/parcellite-1.2.1/src/main.c:2406:54: [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). write_fifo(fifo,FIFO_MODE_CLI,opts->leftovers,strlen(opts->leftovers)); data/parcellite-1.2.1/src/main.c:2411:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000); data/parcellite-1.2.1/src/preferences.c:525:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/parcellite-1.2.1/src/utils.c:60:5: [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). l=strlen(str); data/parcellite-1.2.1/src/utils.c:301: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(NULL == (envf=(g_malloc(strlen("/proc/9999999/environ"))))) { data/parcellite-1.2.1/src/utils.c:337: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). i+=strlen(f); data/parcellite-1.2.1/src/utils.c:738:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i=read(fd,buf,len-t); ANALYSIS SUMMARY: Hits = 57 Lines analyzed = 7191 in approximately 0.26 seconds (27874 lines/second) Physical Source Lines of Code (SLOC) = 4946 Hits@level = [0] 27 [1] 22 [2] 15 [3] 2 [4] 18 [5] 0 Hits@level+ = [0+] 84 [1+] 57 [2+] 35 [3+] 20 [4+] 18 [5+] 0 Hits/KSLOC@level+ = [0+] 16.9834 [1+] 11.5245 [2+] 7.07643 [3+] 4.04367 [4+] 3.6393 [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.