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/superkb-0.23/debug.c Examining data/superkb-0.23/debug.h Examining data/superkb-0.23/drawkblib.c Examining data/superkb-0.23/drawkblib.h Examining data/superkb-0.23/drawkblibs/drawkblibs-cairo.c Examining data/superkb-0.23/drawkblibs/drawkblibs-cairo.h Examining data/superkb-0.23/drawkblibs/drawkblibs-xlib.c Examining data/superkb-0.23/drawkblibs/drawkblibs-xlib.h Examining data/superkb-0.23/drawkblibs/drawkblibs.h Examining data/superkb-0.23/globals.h Examining data/superkb-0.23/imagelib.c Examining data/superkb-0.23/imagelib.h Examining data/superkb-0.23/puticon/puticon-gdkpixbuf.c Examining data/superkb-0.23/puticon/puticon-gdkpixbuf.h Examining data/superkb-0.23/puticon/puticon-imlib2.c Examining data/superkb-0.23/puticon/puticon-imlib2.h Examining data/superkb-0.23/puticon/puticon.h Examining data/superkb-0.23/screeninfo-xinerama.c Examining data/superkb-0.23/screeninfo-xlib.c Examining data/superkb-0.23/screeninfo.h Examining data/superkb-0.23/superkb.c Examining data/superkb-0.23/superkb.h Examining data/superkb-0.23/superkbrc.c Examining data/superkb-0.23/superkbrc.h Examining data/superkb-0.23/timeval.c Examining data/superkb-0.23/timeval.h Examining data/superkb-0.23/version.h Examining data/superkb-0.23/main-help-message.h Examining data/superkb-0.23/main.c FINAL RESULTS: data/superkb-0.23/debug.c:29:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, args); data/superkb-0.23/drawkblib.c:107: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(fn, LIB_PREFIX); data/superkb-0.23/drawkblib.c:109:2: [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(fn, userlib); data/superkb-0.23/imagelib.c:113: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(fn, LIB_PREFIX); data/superkb-0.23/imagelib.c:115:2: [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(fn, userlib); data/superkb-0.23/main.c:78:2: [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(stderr, format, args); data/superkb-0.23/main.c:293:8: [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 (cmdline, config->feedback_handler); data/superkb-0.23/main.c:295:8: [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 (cmdline, config->key_bindings[i].feedback_string); data/superkb-0.23/main.c:297:8: [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. system(cmdline); data/superkb-0.23/main.c:301:6: [4] (shell) execvp: 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. execvp(*argv, argv); data/superkb-0.23/main.c:310:8: [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 (cmdline, config->feedback_handler); data/superkb-0.23/main.c:312:8: [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 (cmdline, config->key_bindings[i].feedback_string); data/superkb-0.23/main.c:314:8: [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. system(cmdline); data/superkb-0.23/main.c:319: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 (cmdline, config->document_handler); data/superkb-0.23/main.c:321:7: [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 (cmdline, config->key_bindings[i].action.document); data/superkb-0.23/main.c:323:7: [4] (shell) execvp: 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. execvp(*argv, argv); data/superkb-0.23/main.c:369: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(cmdline, config->welcome_cmd); data/superkb-0.23/main.c:371:3: [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. system(cmdline); data/superkb-0.23/main.c:421:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(HELP_MESSAGE); data/superkb-0.23/superkb.c:596: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(this->kblayout, kblayout); data/superkb-0.23/superkbrc.c:60: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(this->key_bindings[this->key_bindings_n - 1].action.command, command); data/superkb-0.23/superkbrc.c:64: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(this->key_bindings[this->key_bindings_n - 1].icon, icon); data/superkb-0.23/superkbrc.c:71: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(this->key_bindings[this->key_bindings_n - 1].feedback_string, feedback_string); data/superkb-0.23/superkbrc.c:88: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(this->key_bindings[this->key_bindings_n - 1].action.document, document); data/superkb-0.23/superkbrc.c:92: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(this->key_bindings[this->key_bindings_n - 1].icon, icon); data/superkb-0.23/superkbrc.c:99: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(this->key_bindings[this->key_bindings_n - 1].feedback_string, feedback_string); data/superkb-0.23/superkbrc.c:127:4: [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(feedback_string_quoted, feedback_string); data/superkb-0.23/superkbrc.c:570: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(this->drawkb_font, CONFIG_DEFAULT_DRAWKB_FONT); data/superkb-0.23/superkbrc.c:571: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(this->drawkb_imagelib, CONFIG_DEFAULT_DRAWKB_IMAGELIB); data/superkb-0.23/superkbrc.c:572: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(this->drawkb_drawkblib, CONFIG_DEFAULT_DRAWKB_DRAWKBLIB); data/superkb-0.23/superkbrc.c:582: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(this->document_handler, CONFIG_DEFAULT_DOCUMENT_HANDLER); data/superkb-0.23/superkbrc.c:584: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(this->feedback_handler, CONFIG_DEFAULT_FEEDBACK_HANDLER); data/superkb-0.23/superkbrc.c:588: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(this->welcome_cmd, CONFIG_DEFAULT_WELCOME_CMD); data/superkb-0.23/superkbrc.c:631: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(file, home); data/superkb-0.23/superkbrc.c:632: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(file, "/" CONFIG_FILENAME); data/superkb-0.23/main.c:387:14: [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 ((c = getopt(argc, argv, ":0d:hv")) != -1) { data/superkb-0.23/superkbrc.c:621:15: [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. char *home = getenv("HOME"); data/superkb-0.23/drawkblib.c:108:2: [2] (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). Risk is low because the source is a constant string. strcat(fn, "superkb/drawkblibs-"); data/superkb-0.23/drawkblib.c:110:2: [2] (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). Risk is low because the source is a constant string. strcat(fn, ".so"); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:517: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 buf[1024]=""; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:541: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 name[5]; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:542: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 glyph[256]; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:543: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 keystring[256]; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:872: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 name[5]; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:873: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 glyph[256]; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:874: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 keystring[256]; data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:969: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(&(key_data[key_data_n-1].labelbox), &labelbox, sizeof(XkbBoundsRec)); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:970: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(&(key_data[key_data_n-1].fullbox), &fullbox, sizeof(XkbBoundsRec)); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:241: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 newname[500]; /* big enough for a long font name */ data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:267:5: [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(&newname[j], "%d", size); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:276:5: [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(&newname[j], "%d", (field == 9) ? res_x : res_y); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:434: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(&gc_backup, &gc, sizeof(GC)); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:442: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(&gc, &gc_backup, sizeof(GC)); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:742: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 buf[1024]=""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:759: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 name[5] = ""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:760: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 glyph[256] = ""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:761: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 keystring[256] = ""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:933: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 name[5] = ""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:934: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 glyph[256] = ""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:935: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 keystring[256] = ""; data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:995: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(&(key_data[key_data_n-1].labelbox), &labelbox, sizeof(XkbBoundsRec)); data/superkb-0.23/drawkblibs/drawkblibs.h:32: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 font[500]; data/superkb-0.23/imagelib.c:114:2: [2] (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). Risk is low because the source is a constant string. strcat(fn, "superkb/puticon-"); data/superkb-0.23/imagelib.c:116:2: [2] (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). Risk is low because the source is a constant string. strcat(fn, ".so"); data/superkb-0.23/main.c:283: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 *argv[4] = { "sh", "-c", NULL, NULL }; data/superkb-0.23/main.c:296:8: [2] (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). Risk is low because the source is a constant string. strcat (cmdline, " &"); data/superkb-0.23/main.c:313:8: [2] (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). Risk is low because the source is a constant string. strcat (cmdline, " &"); data/superkb-0.23/main.c:370:3: [2] (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). Risk is low because the source is a constant string. strcat(cmdline, " &"); data/superkb-0.23/main.c:394:26: [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). running_debug_level = atoi(optarg); data/superkb-0.23/main.c:538: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 vals[500] = ""; data/superkb-0.23/main.c:548: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 vals[500] = ""; data/superkb-0.23/screeninfo-xinerama.c:84: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(*screens, xinerama_screens, sizeof(screeninfo_t)*xinerama_screens_n); data/superkb-0.23/superkb.c:159: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 buf[80]; data/superkb-0.23/superkb.c:208: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 key_buffer [32]; data/superkb-0.23/superkb.c:352: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(&timeout_save, &to[to_reason], sizeof(struct timeval)); data/superkb-0.23/superkb.c:364: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(&to[to_reason], &timeout_save, sizeof(struct timeval)); data/superkb-0.23/superkb.c:419:5: [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(&event_save_for_replay, &ev, sizeof(XEvent)); data/superkb-0.23/superkb.h:46: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 kblayout[3]; data/superkb-0.23/superkbrc.c:285: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(token_item, token, wordlength); data/superkb-0.23/superkbrc.c:307:11: [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). input = atoi(token_array[1]); data/superkb-0.23/superkbrc.c:310:47: [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). fprintf(stderr, "Ignoring bad CVER: %d\n", atoi(token_array[1])); data/superkb-0.23/superkbrc.c:350:31: [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). __config->superkb_super1 = atoi(token_array[1]); data/superkb-0.23/superkbrc.c:355:31: [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). __config->superkb_super2 = atoi(token_array[1]); data/superkb-0.23/superkbrc.c:360:32: [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). __config->squashed_states = atoi(token_array[1]); data/superkb-0.23/superkbrc.c:366:30: [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). __config->backcolor.red = atoi(token_array[1]); data/superkb-0.23/superkbrc.c:367:32: [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). __config->backcolor.green = atoi(token_array[2]); data/superkb-0.23/superkbrc.c:368:31: [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). __config->backcolor.blue = atoi(token_array[3]); data/superkb-0.23/superkbrc.c:380:30: [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). __config->forecolor.red = atoi(token_array[1]); data/superkb-0.23/superkbrc.c:381:32: [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). __config->forecolor.green = atoi(token_array[2]); data/superkb-0.23/superkbrc.c:382:31: [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). __config->forecolor.blue = atoi(token_array[3]); data/superkb-0.23/superkbrc.c:462:16: [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). filecheck = fopen (token_array[5], "r"); data/superkb-0.23/superkbrc.c:470:24: [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. validated_param = (char *) token_array[5]; data/superkb-0.23/superkbrc.c:474:38: [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). XStringToKeysym(token_array[2]), atoi(token_array[3]), data/superkb-0.23/superkbrc.c:486:16: [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). filecheck = fopen (token_array[5], "r"); data/superkb-0.23/superkbrc.c:494:24: [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. validated_param = (char *) token_array[5]; data/superkb-0.23/superkbrc.c:498:38: [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). XStringToKeysym(token_array[2]), atoi(token_array[3]), data/superkb-0.23/superkbrc.c:609:7: [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). fd = fopen("/etc/superkbrc", "r"); data/superkb-0.23/superkbrc.c:637:7: [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). fd = fopen(file, "r"); data/superkb-0.23/superkbrc.h:47: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 drawkb_font[500]; data/superkb-0.23/superkbrc.h:48: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 drawkb_imagelib[500]; data/superkb-0.23/superkbrc.h:49: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 drawkb_drawkblib[500]; data/superkb-0.23/superkbrc.h:63: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 document_handler[500]; data/superkb-0.23/superkbrc.h:65: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 feedback_handler[500]; data/superkb-0.23/superkbrc.h:69: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 welcome_cmd[500]; data/superkb-0.23/drawkblib.c:60:2: [1] (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 character. strcpy(buf, ""); data/superkb-0.23/drawkblib.c:65:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, p->code, buf_n); data/superkb-0.23/drawkblib.c:66:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(buf, " ", buf_n); data/superkb-0.23/drawkblib.c:79:30: [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). && strncmp(&entry->d_name[strlen(entry->d_name)-3], ".so", 3) == 0) { data/superkb-0.23/drawkblib.c:80:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, entry->d_name+11, strlen(entry->d_name)-14 > buf_n ? buf_n : strlen(entry->d_name)-14); data/superkb-0.23/drawkblib.c:80:35: [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). strncat(buf, entry->d_name+11, strlen(entry->d_name)-14 > buf_n ? buf_n : strlen(entry->d_name)-14); data/superkb-0.23/drawkblib.c:80: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). strncat(buf, entry->d_name+11, strlen(entry->d_name)-14 > buf_n ? buf_n : strlen(entry->d_name)-14); data/superkb-0.23/drawkblib.c:81:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(buf, " ", buf_n); data/superkb-0.23/drawkblib.c:104:20: [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). char *fn = malloc(strlen(LIB_PREFIX) + strlen("superkb/drawkblibs-") + strlen(userlib) data/superkb-0.23/drawkblib.c:104:41: [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). char *fn = malloc(strlen(LIB_PREFIX) + strlen("superkb/drawkblibs-") + strlen(userlib) data/superkb-0.23/drawkblib.c:104:73: [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). char *fn = malloc(strlen(LIB_PREFIX) + strlen("superkb/drawkblibs-") + strlen(userlib) data/superkb-0.23/drawkblib.c:105: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). + strlen(".so") + 1); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:551:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, _kb->names->keys[i].name, 4); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:556:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(keystring, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:562:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(glyph, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:885:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, _kb->names->keys[i].name, 4); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:893:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(keystring, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:902:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(glyph, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-cairo.c:1260:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->font, font, 499); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:765:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, _kb->names->keys[i].name, 4); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:770:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(keystring, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:775:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(glyph, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:811: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). strlen(glyph)); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:826: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). if (strlen(kss) == 1) { data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:827: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). tw = MyXftTextWidth(this->dpy, fs, glyph, strlen(glyph)); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:841:32: [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). (unsigned char *)kss, strlen(kss)); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:869: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). while (MyXftTextWidth(this->dpy, fs, glyph, strlen(glyph)) <= (int) labelbox_width*scale data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:883: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). while (MyXftTextWidth(this->dpy, fs, glyph, strlen(glyph)) > (int) labelbox_width*scale) { data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:941:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, _kb->names->keys[i].name, 4); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:949:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(keystring, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:955:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(glyph, kss, 255); data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:984: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). } else if (strlen(glyph) == 1) { data/superkb-0.23/drawkblibs/drawkblibs-xlib.c:1185:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(this->font, font, 499); data/superkb-0.23/imagelib.c:64:2: [1] (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 character. strcpy(buf, ""); data/superkb-0.23/imagelib.c:69:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, p->code, buf_n); data/superkb-0.23/imagelib.c:70:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(buf, " ", buf_n); data/superkb-0.23/imagelib.c:83:30: [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). && strncmp(&entry->d_name[strlen(entry->d_name)-3], ".so", 3) == 0) { data/superkb-0.23/imagelib.c:84:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, entry->d_name+8, strlen(entry->d_name)-11 > buf_n ? buf_n : strlen(entry->d_name)-11); data/superkb-0.23/imagelib.c:84: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). strncat(buf, entry->d_name+8, strlen(entry->d_name)-11 > buf_n ? buf_n : strlen(entry->d_name)-11); data/superkb-0.23/imagelib.c:84:77: [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). strncat(buf, entry->d_name+8, strlen(entry->d_name)-11 > buf_n ? buf_n : strlen(entry->d_name)-11); data/superkb-0.23/imagelib.c:85:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(buf, " ", buf_n); data/superkb-0.23/imagelib.c:110:20: [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). char *fn = malloc(strlen(LIB_PREFIX) + strlen("superkb/puticon-") + strlen(userlib) data/superkb-0.23/imagelib.c:110:41: [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). char *fn = malloc(strlen(LIB_PREFIX) + strlen("superkb/puticon-") + strlen(userlib) data/superkb-0.23/imagelib.c:110:70: [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). char *fn = malloc(strlen(LIB_PREFIX) + strlen("superkb/puticon-") + strlen(userlib) data/superkb-0.23/imagelib.c:111: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). + strlen(".so") + 1); data/superkb-0.23/main.c:91:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, config->key_bindings[i].icon, buf_n); data/superkb-0.23/main.c:93:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buf, "", buf_n); data/superkb-0.23/main.c:291:30: [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). char *cmdline = malloc(strlen(config->feedback_handler) + strlen(config->key_bindings[i].feedback_string) + 4); data/superkb-0.23/main.c:291:65: [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). char *cmdline = malloc(strlen(config->feedback_handler) + strlen(config->key_bindings[i].feedback_string) + 4); data/superkb-0.23/main.c:294:8: [1] (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). Risk is low because the source is a constant character. strcat (cmdline, " "); data/superkb-0.23/main.c:308:30: [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). char *cmdline = malloc(strlen(config->feedback_handler) + strlen(config->key_bindings[i].feedback_string) + 4); data/superkb-0.23/main.c:308:65: [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). char *cmdline = malloc(strlen(config->feedback_handler) + strlen(config->key_bindings[i].feedback_string) + 4); data/superkb-0.23/main.c:311:8: [1] (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). Risk is low because the source is a constant character. strcat (cmdline, " "); data/superkb-0.23/main.c:317: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). char *cmdline = malloc(strlen(config->document_handler) + strlen(config->key_bindings[i].action.document) + 2); data/superkb-0.23/main.c:317:64: [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). char *cmdline = malloc(strlen(config->document_handler) + strlen(config->key_bindings[i].action.document) + 2); data/superkb-0.23/main.c:320:7: [1] (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). Risk is low because the source is a constant character. strcat (cmdline, " "); data/superkb-0.23/main.c:363:26: [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). char *cmdline = malloc(strlen(config->welcome_cmd)+3); data/superkb-0.23/superkbrc.c:59:71: [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). this->key_bindings[this->key_bindings_n - 1].action.command = malloc(strlen(command)+1); data/superkb-0.23/superkbrc.c:63:62: [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). this->key_bindings[this->key_bindings_n - 1].icon = malloc(strlen(icon)+1); data/superkb-0.23/superkbrc.c:70:73: [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). this->key_bindings[this->key_bindings_n - 1].feedback_string = malloc(strlen(feedback_string)+1); data/superkb-0.23/superkbrc.c:87:72: [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). this->key_bindings[this->key_bindings_n - 1].action.document = malloc(strlen(document)+1); data/superkb-0.23/superkbrc.c:91:62: [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). this->key_bindings[this->key_bindings_n - 1].icon = malloc(strlen(icon)+1); data/superkb-0.23/superkbrc.c:98:73: [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). this->key_bindings[this->key_bindings_n - 1].feedback_string = malloc(strlen(feedback_string)+1); data/superkb-0.23/superkbrc.c:115:53: [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 (feedback_string[0] == '\'' && feedback_string[strlen(feedback_string) - 1] == '\'') { data/superkb-0.23/superkbrc.c:124:35: [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). feedback_string_quoted = malloc(strlen(feedback_string) + 3); data/superkb-0.23/superkbrc.c:126:4: [1] (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 character. strcpy(feedback_string_quoted, "'"); data/superkb-0.23/superkbrc.c:128:4: [1] (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). Risk is low because the source is a constant character. strcat(feedback_string_quoted, "'"); data/superkb-0.23/superkbrc.c:219:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = fgetc(in)) != EOF && (c != '\n')) { data/superkb-0.23/superkbrc.c:320:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(__config->drawkb_font, token_array[1], 500); data/superkb-0.23/superkbrc.c:325:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(__config->drawkb_imagelib, token_array[1], 500); data/superkb-0.23/superkbrc.c:330:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(__config->drawkb_drawkblib, token_array[1], 500); data/superkb-0.23/superkbrc.c:335:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(__config->document_handler, token_array[1], 500); data/superkb-0.23/superkbrc.c:432:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(__config->feedback_handler, token_array[1], 500); data/superkb-0.23/superkbrc.c:437:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(__config->welcome_cmd, token_array[1], 500); data/superkb-0.23/superkbrc.c:625:17: [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). file = malloc(strlen(home) + strlen("/" CONFIG_FILENAME)+1); data/superkb-0.23/superkbrc.c:625:32: [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). file = malloc(strlen(home) + strlen("/" CONFIG_FILENAME)+1); ANALYSIS SUMMARY: Hits = 180 Lines analyzed = 5770 in approximately 0.19 seconds (29914 lines/second) Physical Source Lines of Code (SLOC) = 3908 Hits@level = [0] 56 [1] 76 [2] 67 [3] 2 [4] 35 [5] 0 Hits@level+ = [0+] 236 [1+] 180 [2+] 104 [3+] 37 [4+] 35 [5+] 0 Hits/KSLOC@level+ = [0+] 60.3889 [1+] 46.0594 [2+] 26.6121 [3+] 9.46776 [4+] 8.95599 [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.