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/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c Examining data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.h Examining data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c Examining data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.h FINAL RESULTS: data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:308:10: [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(tmp_buffer, ptr); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:321:10: [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(tmp, mo->buffer); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:322:10: [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(mo->buffer, tmp_buffer); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:323:10: [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(mo->buffer + tmp_bufsize, tmp); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:609:26: [3] (random) random: 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. DBG("! return %d",mo->random); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:610:15: [3] (random) random: 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. return mo->random; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:613:43: [3] (random) random: 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. int mpd_player_set_random(MpdObj* mo, int random) data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:617:51: [3] (random) random: 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. snprintf(outbuf, sizeof(outbuf), "random %d\n",random); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.h:69:8: [3] (random) random: 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. int random; data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:510:60: [3] (random) random: 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. gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(mpc->random), mpd_player_get_random(mpc->mo)); data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:789:36: [3] (random) random: 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. g_signal_connect (G_OBJECT(mpc->random), "toggled", G_CALLBACK (mpc_random_toggled), mpc); data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:796:65: [3] (random) random: 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. xfce_panel_plugin_menu_insert_item(plugin,GTK_MENU_ITEM(mpc->random)); data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:801:26: [3] (random) random: 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. gtk_widget_show (mpc->random); data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.h:41:53: [3] (random) random: 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. GtkWidget *frame,*box,*prev,*stop,*toggle,*next,*random,*repeat,*appl,*about; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:110: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((char *)&remote_si.sin_addr.s_addr,( char *)remote_he->h_addr, remote_he->h_length); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:310:10: [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, "OK\n"); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:355:62: [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). if (0 == strcmp("volume",tokens[0])) mo->curvol = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:356:62: [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). else if (0 == strcmp("repeat",tokens[0])) mo->repeat = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:357:62: [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). else if (0 == strcmp("random",tokens[0])) mo->random = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:358:78: [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). else if (0 == strcmp("playlistlength",tokens[0])) mo->playlistlength = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:365:58: [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). else if (0 == strcmp("song",tokens[0])) mo->song = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:366:62: [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). else if (0 == strcmp("songid",tokens[0])) mo->songid = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:401:76: [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). else if (ms->pos < 0 && 0 == strcmp("Pos", tokens[0])) ms->pos = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:402:76: [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). else if (ms->id < 0 && 0 == strcmp("Id", tokens[0])) ms->id = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:436:79: [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). else if (ms->pos < 0 && 0 == strcmp("Pos", tokens[0])) ms->pos = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:437:79: [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). else if (ms->id < 0 && 0 == strcmp("Id", tokens[0])) ms->id = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:464:83: [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). if (0 == strcmp("outputid",tokens[0])) md->alloutputs[md->nb]->id = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:466:93: [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). else if (0 == strcmp("outputenabled",tokens[0])) md->alloutputs[md->nb]->enabled = atoi(tokens[1]); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:585:4: [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 outbuf[18]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:594:4: [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 outbuf[15]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:615:4: [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 outbuf[15]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:624:4: [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 outbuf[15]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:671:4: [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 outbuf[15]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:685:4: [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 outbuf[256]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.h:73:4: [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[MAXBUFLEN*2]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:90:4: [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 str[30]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:182:4: [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 str[128]; data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:187: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). mpc->mpd_port = atoi(gtk_entry_get_text(GTK_ENTRY(dialog->textbox_port))); data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:162:48: [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 (strncmp(mo->buffer,MPD_WELCOME_MESSAGE, strlen(MPD_WELCOME_MESSAGE))) data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:247:42: [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 ((nbwri = send(mo->socket, cmd, strlen(cmd), 0)) <= 0) data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:284:42: [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 ((nbwri = send(mo->socket, cmd, strlen(cmd), 0)) < 0) data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:294:78: [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). while (!mo->error && ( nbread == MAXBUFLEN || 0 != strcmp(mo->buffer + strlen(mo->buffer) - 3,"OK\n"))) data/xfce4-mpc-plugin-0.5.2/panel-plugin/simple-libmpd.c:309:24: [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_bufsize = strlen(tmp_buffer); data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:172: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(mpc->mpd_password)) data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:193: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). if (0 == strlen(mpc->client_appl)) data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:195: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). if (0 == strlen(mpc->tooltip_format)) data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:197: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). if (0 == strlen(mpc->playlist_format)) data/xfce4-mpc-plugin-0.5.2/panel-plugin/xfce4-mpc-plugin.c:211: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(mpc->mpd_password)) ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 1794 in approximately 0.07 seconds (27380 lines/second) Physical Source Lines of Code (SLOC) = 1448 Hits@level = [0] 9 [1] 10 [2] 24 [3] 10 [4] 4 [5] 0 Hits@level+ = [0+] 57 [1+] 48 [2+] 38 [3+] 14 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 39.3646 [1+] 33.1492 [2+] 26.2431 [3+] 9.66851 [4+] 2.76243 [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.