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/gjiten-2.6/src/kanjidic.h Examining data/gjiten-2.6/src/constants.h Examining data/gjiten-2.6/src/gjiten.h Examining data/gjiten-2.6/src/worddic.h Examining data/gjiten-2.6/src/error.c Examining data/gjiten-2.6/src/error.h Examining data/gjiten-2.6/src/radical-convtable.h Examining data/gjiten-2.6/src/dicfile.h Examining data/gjiten-2.6/src/pref.h Examining data/gjiten-2.6/src/dicutil.c Examining data/gjiten-2.6/src/dicutil.h Examining data/gjiten-2.6/src/dicfile.c Examining data/gjiten-2.6/src/conf.c Examining data/gjiten-2.6/src/conf.h Examining data/gjiten-2.6/src/gjiten.c Examining data/gjiten-2.6/src/kanjidic.c Examining data/gjiten-2.6/src/pref.c Examining data/gjiten-2.6/src/worddic.c FINAL RESULTS: data/gjiten-2.6/src/error.h:28:27: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define GJITEN_DEBUG(...) fprintf(stderr, __VA_ARGS__) data/gjiten-2.6/src/gjiten.c:133:5: [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(kpad_cmd); /* FIXME */ data/gjiten-2.6/src/worddic.c:242: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(deinflected + strlen(srchstrg) - strlen(tmp_vinfl_struct->conj), data/gjiten-2.6/src/dicfile.c:88:19: [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). dicfile->file = open(dicfile->path, O_RDONLY); data/gjiten-2.6/src/gjiten.c:120:21: [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). kanjipad_binary = fopen(gjitenApp->conf->kanjipad, "r"); data/gjiten-2.6/src/kanjidic.c:68: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 tmpstr[KBUFSIZE]; data/gjiten-2.6/src/kanjidic.c:325:10: [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. static char srchkey[10]; data/gjiten-2.6/src/kanjidic.c:746:8: [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(radkfile_name, O_RDONLY); data/gjiten-2.6/src/kanjidic.c:790:27: [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). rad_info->strokes = atoi(radkfile_ptr); //Store the stroke number data/gjiten-2.6/src/worddic.c:119:8: [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(VINFL_FILENAME, O_RDONLY); data/gjiten-2.6/src/worddic.c:153:17: [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). conj_type = atoi(vinfl_ptr); data/gjiten-2.6/src/worddic.c:185:44: [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). tmp_vinfl_struct->type = vconj_types[atoi(vinfl_ptr)]; data/gjiten-2.6/src/conf.c:152: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). if ((conf->kanjidic->path == NULL) || (strlen(conf->kanjidic->path)) == 0) { data/gjiten-2.6/src/dicfile.c:73:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytesread = read(dicfile->file, testbuffer, 3000); // read a chunk into buffer data/gjiten-2.6/src/dicutil.c:46: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). if (strlen(strg1) < strlen(strg2)) return FALSE; data/gjiten-2.6/src/dicutil.c:46:23: [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(strg1) < strlen(strg2)) return FALSE; data/gjiten-2.6/src/dicutil.c:48:23: [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). strg1_end = strg1 + strlen(strg1); data/gjiten-2.6/src/dicutil.c:49:23: [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). strg2_end = strg2 + strlen(strg2); data/gjiten-2.6/src/dicutil.c:76: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). line_end = line + strlen(line); data/gjiten-2.6/src/dicutil.c:152:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(res_str, linestart, copySize); data/gjiten-2.6/src/dicutil.c:164: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). srchstrglen = strlen(srchstrg); data/gjiten-2.6/src/dicutil.c:192: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). if ( (int) (strlen(src) - 1) <= k) return(0); data/gjiten-2.6/src/dicutil.c:257: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). gchar *kata = g_new0(gchar, strlen(hirastr) + 6); data/gjiten-2.6/src/dicutil.c:268:7: [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(kataptr, hiraptr, length); data/gjiten-2.6/src/dicutil.c:281: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). gchar *hira = g_new0(gchar, strlen(katastr) + 6); data/gjiten-2.6/src/dicutil.c:292:7: [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(hiraptr, kataptr, length); data/gjiten-2.6/src/gjiten.c:128: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(gjitenApp->conf->kanjipad) + 2; data/gjiten-2.6/src/gjiten.c:131:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kpad_cmd, gjitenApp->conf->kanjipad, len); data/gjiten-2.6/src/gjiten.c:132:5: [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(kpad_cmd, "&", 1); data/gjiten-2.6/src/kanjidic.c:88:11: [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(kdic_line + READING * KBUFSIZE) != 0) { data/gjiten-2.6/src/kanjidic.c:89:5: [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 string. strncat(kdic_line + READING * KBUFSIZE, ", ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:89: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). strncat(kdic_line + READING * KBUFSIZE, ", ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:91: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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:91:63: [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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:95: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(kdic_line + READING * KBUFSIZE) != 0) { data/gjiten-2.6/src/kanjidic.c:96:7: [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 string. strncat(kdic_line + READING * KBUFSIZE, ", ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:96: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). strncat(kdic_line + READING * KBUFSIZE, ", ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:98:6: [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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:98: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). strncat(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:103:11: [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(kdic_line + READING * KBUFSIZE) != 0) { data/gjiten-2.6/src/kanjidic.c:104:8: [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 string. strncat(kdic_line + READING * KBUFSIZE, ", ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:104: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). strncat(kdic_line + READING * KBUFSIZE, ", ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:105:8: [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 string. strncat(kdic_line + READING * KBUFSIZE, _("Name readings:"), KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:105:80: [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(kdic_line + READING * KBUFSIZE, _("Name readings:"), KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:108:8: [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 string. strncat(kdic_line + READING * KBUFSIZE, _("Name readings:"), KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:108:80: [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(kdic_line + READING * KBUFSIZE, _("Name readings:"), KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:111:7: [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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:111:66: [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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:115:11: [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(kdic_line + READING * KBUFSIZE) != 0) { data/gjiten-2.6/src/kanjidic.c:116:8: [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 string. strncat(kdic_line + READING * KBUFSIZE, ", Radical Name: ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:116:79: [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(kdic_line + READING * KBUFSIZE, ", Radical Name: ", KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:119:8: [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 string. strncat(kdic_line + READING * KBUFSIZE, _("Radical name:"), KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:119:79: [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(kdic_line + READING * KBUFSIZE, _("Radical name:"), KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:122:7: [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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:122:66: [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(kdic_line + READING * KBUFSIZE, tmpstr, KBUFSIZE - strlen(kdic_line + READING * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:127: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(kdic_line + ENGLISH * KBUFSIZE) != 0 ) { data/gjiten-2.6/src/kanjidic.c:128:7: [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(kdic_line + ENGLISH * KBUFSIZE, " ", KBUFSIZE - strlen(kdic_line + ENGLISH * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:128:63: [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(kdic_line + ENGLISH * KBUFSIZE, " ", KBUFSIZE - strlen(kdic_line + ENGLISH * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:130:6: [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(kdic_line + ENGLISH * KBUFSIZE, tmpstr + 1, KBUFSIZE - strlen(kdic_line + ENGLISH * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:130:69: [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(kdic_line + ENGLISH * KBUFSIZE, tmpstr + 1, KBUFSIZE - strlen(kdic_line + ENGLISH * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:131:6: [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(kdic_line + ENGLISH * KBUFSIZE, ";", KBUFSIZE - strlen(kdic_line + ENGLISH * KBUFSIZE) - 1); // put endmark: ; data/gjiten-2.6/src/kanjidic.c:131: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). strncat(kdic_line + ENGLISH * KBUFSIZE, ";", KBUFSIZE - strlen(kdic_line + ENGLISH * KBUFSIZE) - 1); // put endmark: ; data/gjiten-2.6/src/kanjidic.c:135:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + BUSHU * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:139:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + CLASSIC * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:143:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + FREQ * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:147:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + JOUYOU * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:151:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + HINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:155:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + NINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:159:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + VINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:163:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + DEROO * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:167:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + SKIP * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:171: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(kdic_line + STROKES * KBUFSIZE) == 0) { data/gjiten-2.6/src/kanjidic.c:172:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + STROKES * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:175:7: [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 string. strncat(kdic_line + STROKES * KBUFSIZE, _(", Common miscount: "), KBUFSIZE - strlen(kdic_line + STROKES * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:175:84: [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(kdic_line + STROKES * KBUFSIZE, _(", Common miscount: "), KBUFSIZE - strlen(kdic_line + STROKES * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:176:7: [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(kdic_line + STROKES * KBUFSIZE, tmpstr + 1, KBUFSIZE - strlen(kdic_line + STROKES * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:176: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). strncat(kdic_line + STROKES * KBUFSIZE, tmpstr + 1, KBUFSIZE - strlen(kdic_line + STROKES * KBUFSIZE) - 1); data/gjiten-2.6/src/kanjidic.c:181:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + UNI * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:185:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + IINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:189:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + FOURC * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:193:28: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). if (tmpstr[1] == 'N') strncpy(kdic_line + MNINDEX * KBUFSIZE, tmpstr + 2, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:194:33: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). else if (tmpstr[1] == 'P') strncpy(kdic_line + MPINDEX * KBUFSIZE, tmpstr + 2, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:198:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + EINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:202:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + KINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:206:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + LINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:210:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + OINDEX * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:214:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + KOREAN * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:218:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + PINYIN * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:222:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + CREF * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:226:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(kdic_line + MISSC * KBUFSIZE, tmpstr + 1, KBUFSIZE); data/gjiten-2.6/src/kanjidic.c:432: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(kentry) > 0) && (push == TRUE) ) { data/gjiten-2.6/src/kanjidic.c:447: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(radentry) > 0) && push) { data/gjiten-2.6/src/kanjidic.c:503:76: [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 ((found) && (GTK_TOGGLE_BUTTON(kanjiDic->checkb_ksearch)->active) && (strlen(kentry) >= 1)) { data/gjiten-2.6/src/kanjidic.c:595:39: [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). newradline = g_strndup(radline_ptr, strlen(radline_ptr) + 6); //Enough space for one more character data/gjiten-2.6/src/kanjidic.c:598: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). for (i = 0; i < (int) (strlen(newradline) + 6); i++) newradline[i] = 0; //clear newradline data/gjiten-2.6/src/kanjidic.c:605:7: [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(newradline, tmpchar, 5); data/gjiten-2.6/src/kanjidic.c:611:24: [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. if (removed == FALSE) strncat(newradline, radical_selected, 5); //Add the radical to the line data/gjiten-2.6/src/kanjidic.c:761: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). radkfile_end = radkfile + strlen(radkfile); //FIXME: lseek data/gjiten-2.6/src/kanjidic.c:973: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 ((gjitenApp->conf->largefont == NULL) || (strlen(gjitenApp->conf->largefont) == 0)) { data/gjiten-2.6/src/kanjidic.c:990: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). if ((gjitenApp->conf->normalfont != NULL) && (strlen(gjitenApp->conf->normalfont) != 0)) { data/gjiten-2.6/src/pref.c:158: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). if ((entrytext == NULL) || (strlen(entrytext) == 0)) gtk_entry_set_text(entry, old); data/gjiten-2.6/src/pref.c:349: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). if ((kanjidic_path != NULL) && strlen(kanjidic_path) data/gjiten-2.6/src/pref.c:355: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). if ((kanjipad_path != NULL) && strlen(kanjipad_path) data/gjiten-2.6/src/worddic.c:139: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). vinfl_end = vinfl_start + strlen(vinfl_start); data/gjiten-2.6/src/worddic.c:206:23: [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). hl_end = hl_start + strlen(dicfile->name); data/gjiten-2.6/src/worddic.c:234:36: [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). deinflected = (gchar *) g_malloc(strlen(srchstrg) + 20); data/gjiten-2.6/src/worddic.c:241:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(deinflected, srchstrg, strlen(srchstrg) - strlen(tmp_vinfl_struct->conj)); data/gjiten-2.6/src/worddic.c:241: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). strncpy(deinflected, srchstrg, strlen(srchstrg) - strlen(tmp_vinfl_struct->conj)); data/gjiten-2.6/src/worddic.c:241:57: [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). strncpy(deinflected, srchstrg, strlen(srchstrg) - strlen(tmp_vinfl_struct->conj)); data/gjiten-2.6/src/worddic.c:242:28: [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). strcpy(deinflected + strlen(srchstrg) - strlen(tmp_vinfl_struct->conj), data/gjiten-2.6/src/worddic.c:242: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). strcpy(deinflected + strlen(srchstrg) - strlen(tmp_vinfl_struct->conj), data/gjiten-2.6/src/worddic.c:268:14: [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(tmp_vinfl_struct->conj) == strlen(srchstrg)) data/gjiten-2.6/src/worddic.c:268: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). else if (strlen(tmp_vinfl_struct->conj) == strlen(srchstrg)) data/gjiten-2.6/src/worddic.c:314: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). if ((size_t) (currentchar - txt2print) >= strlen(txt2print)) break; data/gjiten-2.6/src/worddic.c:347:36: [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 (currentchar < txt2print + strlen(txt2print)) { data/gjiten-2.6/src/worddic.c:393:67: [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 ((currchar = g_utf8_find_next_char(currchar, srchstrg + strlen(srchstrg))) != NULL); data/gjiten-2.6/src/worddic.c:452: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 ((repstr[roff - 1] == '/') && (repstr[roff + strlen(srchstrg)] == '/')) printit = TRUE; data/gjiten-2.6/src/worddic.c:454: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). else if ((repstr[roff - 2] == ')') && (repstr[roff + strlen(srchstrg)] == '/')) printit = TRUE; data/gjiten-2.6/src/worddic.c:456:87: [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 ((repstr[roff - 2] == 'o') && (repstr[roff - 3] == 't') && (repstr[roff + strlen(srchstrg)] == '/') data/gjiten-2.6/src/worddic.c:460: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). if ((g_unichar_isalpha(g_utf8_get_char(repstr + roff + strlen(srchstrg))) == FALSE) && data/gjiten-2.6/src/worddic.c:566: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). while (g_ascii_isspace(srchstrg[strlen(srchstrg)-1]) != 0) srchstrg[strlen(srchstrg)-1] = 0; data/gjiten-2.6/src/worddic.c:566: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). while (g_ascii_isspace(srchstrg[strlen(srchstrg)-1]) != 0) srchstrg[strlen(srchstrg)-1] = 0; data/gjiten-2.6/src/worddic.c:568: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). if (strlen(srchstrg) == 0) return; data/gjiten-2.6/src/worddic.c:616: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). if (strlen(new_entry_text) == 0) return; data/gjiten-2.6/src/worddic.c:784: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 ((gjitenApp->conf->largefont == NULL) || (strlen(gjitenApp->conf->largefont) == 0)) { data/gjiten-2.6/src/worddic.c:800: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). if ((gjitenApp->conf->normalfont != NULL) && (strlen(gjitenApp->conf->normalfont) != 0)) { ANALYSIS SUMMARY: Hits = 126 Lines analyzed = 4763 in approximately 0.17 seconds (28264 lines/second) Physical Source Lines of Code (SLOC) = 3488 Hits@level = [0] 10 [1] 114 [2] 9 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 136 [1+] 126 [2+] 12 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 38.9908 [1+] 36.1239 [2+] 3.44037 [3+] 0.860092 [4+] 0.860092 [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.