anthy-unicode-1.0.0.20240502-8.fc42

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c: scope_hint: In function ‘init_input_info’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c:95:13: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘m’
#   93|     struct input_info *m;
#   94|     m = malloc(sizeof(struct input_info));
#   95|->   m->seg_is = input_set_create();
#   96|     m->cand_is = input_set_create();
#   97|     m->indep_corpus = corpus_new();

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c: scope_hint: In function ‘dump_features’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c:337:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘lines’
#  335|     for (il = input_set_get_input_line(is), i = 0; i < nr;
#  336|          i++, il = il->next_line) {
#  337|->     lines[i] = il;
#  338|     }
#  339|     /* sort */

Error: GCC_ANALYZER_WARNING (CWE-688): [#def3]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c:340:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘lines’ where non-null expected
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c:38: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null
#  338|     }
#  339|     /* sort */
#  340|->   qsort(lines, nr, sizeof(struct input_line *), compare_line);
#  341|     /* output */
#  342|     fprintf(ofp, "%d %d total_line_weight,count\n", weight, nr);

Error: GCC_ANALYZER_WARNING (CWE-122): [#def4]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c: scope_hint: In function ‘string_pool_sort’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c:487:22: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c: scope_hint: In function ‘string_pool_sort’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/calctrans.c:487:22: note: write of 8 bytes to beyond the end of the region
#  485|       struct string_node *node;
#  486|       for (node = sp->hash[h].next_hash; node; node = node->next_hash) {
#  487|->       sp->array[idx] = node;
#  488|         idx ++;
#  489|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/corpus.c: scope_hint: In function ‘corpus_setup_bucket’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/corpus.c:90:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*c.buckets’
#   88|     c->buckets = malloc(sizeof(struct bucket) * nr);
#   89|     for (i = 0; i < nr; i++) {
#   90|->     c->buckets[i].key = -1;
#   91|       c->buckets[i].first_idx = -1;
#   92|       c->buckets[i].last_idx = -1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def6]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/input_set.c: scope_hint: In function ‘find_same_line’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/input_set.c:60:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*is.buckets[<unknown>]’
#   58|     struct input_line *il;
#   59|     int h = line_hash(features, nr);
#   60|->   for (il = is->buckets[h]; il; il = il->next_in_hash) {
#   61|       int i;
#   62|       if (il->nr_features != nr) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/input_set.c: scope_hint: In function ‘int_map_flatten’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/input_set.c:313:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*im.array’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/input_set.c:10: included_from: Included from here.
#  311|   		     im->array_size);
#  312|     for (i = 0; i < im->array_size; i++) {
#  313|->     im->array[i] = NULL;
#  314|     }
#  315|     /* 要素を置いていく */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘find_candidate’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c:67:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*cr.cand_check’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘find_candidate’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘find_candidate’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘find_candidate’
#   65|       /* 候補ミスのマーク「~」をスキップする */
#   66|       seg++;
#   67|->     cr->cand_check[nth] = 1;
#   68|     }
#   69|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘proc_sentence’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c:134:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*cr.cand_check’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘proc_sentence’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/calctrans/proccorpus.c: scope_hint: In function ‘proc_sentence’
#  132|     cr->cand_check = malloc(sizeof(int) * acs.nr_segment);
#  133|     for (i = 0; i < acs.nr_segment; i++) {
#  134|->     cr->cand_check[i] = 0;
#  135|     }
#  136|   

Error: GCC_ANALYZER_WARNING (CWE-415): [#def10]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c: scope_hint: In function ‘get_node_id_by_name’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c:79:16: warning[-Wanalyzer-double-free]: double-‘free’ of ‘0’
#   77|     }
#   78|     gNodes = tmp;
#   79|->   if (!(tmp2 = realloc(gNodeNames, sizeof(char*)*(nrNodes+1)))) {
#   80|       anthy_log(0, "Could not realloc gNodeNames.\n");
#   81|       free(gNodes);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def11]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c: scope_hint: In function ‘parse_dep’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c:230:7: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘s’ where non-null expected
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c:27: included_from: Included from here.
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  228|       char *s;
#  229|       s = strdup(&tokens[row][1]);
#  230|->     s[strlen(s)-1] =0;
#  231|       strs[nr_strs] = anthy_cstr_to_xstr(s, ANTHY_UTF8_ENCODING);
#  232|       nr_strs ++;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c: scope_hint: In function ‘write_file’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c:461:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file_name, "w")’
#  459|     }
#  460|     /* 各ルール */
#  461|->   write_nl(fp, nrRules);
#  462|     for (i = 0; i < nrRules; ++i) {
#  463|       write_wtype(fp, gRules[i].wt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/depgraph/mkdepgraph.c:461:3: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file_name, "w")’
#  459|     }
#  460|     /* 各ルール */
#  461|->   write_nl(fp, nrRules);
#  462|     for (i = 0; i < nrRules; ++i) {
#  463|       write_wtype(fp, gRules[i].wt);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkanthydic/mkfiledic.c: scope_hint: In function ‘create_file_dic’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkanthydic/mkfiledic.c:95:46: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fn, "w")’
#   93|     int contents_offset;
#   94|   
#   95|->   name_offset = sizeof(int) * (1 + entry_num * 3);
#   96|     contents_offset = name_offset;
#   97|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkanthydic/mkfiledic.c:95:46: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fn, "w")’
#   93|     int contents_offset;
#   94|   
#   95|->   name_offset = sizeof(int) * (1 + entry_num * 3);
#   96|     contents_offset = name_offset;
#   97|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c: scope_hint: In function ‘open_output_files’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c:124:14: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(&buf)’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c:38: included_from: Included from here.
#  122|       } else {
#  123|         *(fs->fpp) = fdopen(fd, "w+");
#  124|->       fs->fn = strdup(buf);
#  125|       }
#  126|       /**/

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c:124:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fdopen(mkstemp(&buf), "w+")’
#  122|       } else {
#  123|         *(fs->fpp) = fdopen(fd, "w+");
#  124|->       fs->fn = strdup(buf);
#  125|       }
#  126|       /**/

Error: GCC_ANALYZER_WARNING (CWE-688): [#def18]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c: scope_hint: In function ‘push_back_word_entry_line’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c:375:15: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ent’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  373|   			  const char *ent)
#  374|   {
#  375|->   char *buf = alloca(strlen(ent) + 1);
#  376|     char *cur = buf;
#  377|     char *n;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c: scope_hint: In function ‘find_yomi_entry’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/mkdic.c:525:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ye’
#  523|     /* 無いので確保 */
#  524|     ye = malloc(sizeof(struct yomi_entry));
#  525|->   ye->nr_entries = 0;
#  526|     ye->entries = 0;
#  527|     ye->next = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def20]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/writewords.c: scope_hint: In function ‘compare_word_entry’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/mkworddic/writewords.c:66:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘prev_we’
#   64|   		   struct word_entry *we)
#   65|   {
#   66|->   if (strcmp(prev_we->wt_name, we->wt_name) ||
#   67|         (prev_we->freq / 100) != (we->freq / 100) ||
#   68|         prev_we->feature != we->feature) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/conf.c: scope_hint: In function 'ensure_buffer'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/conf.c:126:13: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  124|       eb->size += required;
#  125|       eb->buf = realloc(eb->buf, eb->size);
#  126|->     eb->cur = &eb->buf[eb->len];
#  127|     }
#  128|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def22]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/conf.c: scope_hint: In function 'add_val'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/conf.c:177:8: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  175|     struct val_ent *e;
#  176|     e = find_val_ent(var);
#  177|->   if (e->val) {
#  178|       free((void *)e->val);
#  179|     }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/conf.c: scope_hint: In function 'anthy_conf_get_str'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/conf.c:279:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  277|     struct val_ent *e;
#  278|     e = find_val_ent(var);
#  279|->   if (!e->val && var)
#  280|       return getenv (var);
#  281|     return e->val;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def24]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/file_dic.c: scope_hint: In function 'anthy_mkdir_with_parents'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/file_dic.c:200:12: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/file_dic.c:18: included_from: Included from here.
#  198|   
#  199|     do {
#  200|->     while (*p && !ANTHY_IS_DIR_SEPARATOR (*p))
#  201|         p++;
#  202|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c: scope_hint: In function 'anthy_cstr_to_xstr'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:192:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)xlengthofcstr(c) * 4)'
#  190|     for (i = 0, j = 0; i < l; i++) {
#  191|       if (!(c[j] & 0x80)){
#  192|->       x->str[i] = c[j];
#  193|         j++;
#  194|       } else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def26]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:196:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)xlengthofcstr(c) * 4)'
#  194|       } else {
#  195|         unsigned char *p = (unsigned char *)&c[j];
#  196|->       x->str[i] = (p[1] | (p[0]<<8)) | 0x8080;
#  197|         x->str[i] = anthy_euc_to_ucs(x->str[i]);
#  198|         j++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def27]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c: scope_hint: In function 'anthy_xstr_to_cstr'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:217:14: warning[-Wanalyzer-null-dereference]: dereference of NULL '*s.str + (long unsigned int)i * 4'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:31: included_from: Included from here.
#  215|     l = s->len;
#  216|     for (i = 0; i < s->len; i++) {
#  217|->     int ec = anthy_ucs_to_euc(s->str[i]);
#  218|       if (ec > 255) {
#  219|         l++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c: scope_hint: In function 'anthy_xstr_wide_num_to_num'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:248:13: warning[-Wanalyzer-malloc-leak]: leak of 'anthy_xstr_dup(src_xs)'
#  246|     if (!x)
#  247|       return NULL;
#  248|->   x->len = s->len;
#  249|     if (s->len) {
#  250|       assert(s->str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c: scope_hint: In function 'anthy_conv_half_wide'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:248:13: warning[-Wanalyzer-malloc-leak]: leak of 'anthy_xstr_dup(xs)'
#  246|     if (!x)
#  247|       return NULL;
#  248|->   x->len = s->len;
#  249|     if (s->len) {
#  250|       assert(s->str);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def30]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c: scope_hint: In function 'anthy_xstr_hira_to_half_kata'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:612:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)len * 4)'
#  610|       const struct half_kana_table *tab = anthy_find_half_kana(src_xs->str[i]);
#  611|       if (tab) {
#  612|->       xs->str[j] = anthy_euc_to_ucs(tab->dst);
#  613|         if (tab->mod) {
#  614|   	j++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def31]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-diclib/xstr.c:618:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)len * 4)'
#  616|         }
#  617|       } else {
#  618|->       xs->str[j] = src_xs->str[i];
#  619|       }
#  620|       j++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def32]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-main/context.c: scope_hint: In function 'make_metaword_array'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-main/context.c:177:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '*se.mw_array + (long unsigned int)j * 8'
#  175|       se->mw_array = malloc(sizeof(struct meta_word*) * se->nr_metaword);
#  176|       for (j = 0; j < se->nr_metaword; j++) {
#  177|->       se->mw_array[j] = anthy_get_nth_metaword(&ac->split_info, se->from, i, j);
#  178|       }
#  179|       return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c: scope_hint: In function 'enum_candidates'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:73:24: warning[-Wanalyzer-malloc-leak]: leak of 'dup_candidate(ce)'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:35: included_from: Included from here.
#   71|     if (!(ce_new = alloc_cand_ent()))
#   72|       return NULL;
#   73|->   ce_new->nr_words = ce->nr_words;
#   74|     ce_new->str.len = ce->str.len;
#   75|     ce_new->str.str = anthy_xstr_dup_str(&ce->str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c: scope_hint: In function 'push_back_candidate'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:104:18: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  102|       anthy_log(0, "Failed realloc in %s:%d\n", __FILE__, __LINE__);
#  103|       seg->cands = cands;
#  104|->     seg->nr_cands--;
#  105|       return;
#  106|     }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def35]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c: scope_hint: In function 'make_candidate_from_simple_metaword'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:351:16: warning[-Wanalyzer-null-dereference]: dereference of NULL 'alloc_cand_ent()'
#  349|     /* 複数(1も含む)の単語で構成される文節に単語を割当てていく */
#  350|     ce = alloc_cand_ent();
#  351|->   ce->nr_words = mw->nr_parts;
#  352|     ce->str.str = NULL;
#  353|     ce->str.len = 0;

Error: COMPILER_WARNING: [#def36]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c: scope_hint: In function 'make_candidate_from_simple_metaword'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:354:33: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#  354 |   if (!(ce->elm = calloc(sizeof(struct cand_elm),ce->nr_words))) {
#      |                                 ^~~~~~
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:354:33: note: earlier argument should specify number of elements, later size of each element
#  352|     ce->str.str = NULL;
#  353|     ce->str.len = 0;
#  354|->   if (!(ce->elm = calloc(sizeof(struct cand_elm),ce->nr_words))) {
#  355|       anthy_log(0, "Failed calloc in %s:%d\n", __FILE__, __LINE__);
#  356|       ce->nr_words = 0;

Error: COMPILER_WARNING: [#def37]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c: scope_hint: In function 'make_candidate_from_combined_metaword'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:396:33: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument
#  396 |   if (!(ce->elm = calloc(sizeof(struct cand_elm),ce->nr_words))) {
#      |                                 ^~~~~~
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/compose.c:396:33: note: earlier argument should specify number of elements, later size of each element
#  394|     ce->str.str = NULL;
#  395|     ce->str.len = 0;
#  396|->   if (!(ce->elm = calloc(sizeof(struct cand_elm),ce->nr_words))) {
#  397|       anthy_log(0, "Failed malloc in %s:%d\n", __FILE__, __LINE__);
#  398|       free(ce);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/lattice.c: scope_hint: In function 'alloc_lattice_info'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/lattice.c:228:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'info'
#  226|     int i;
#  227|     struct lattice_info* info = (struct lattice_info*)malloc(sizeof(struct lattice_info));
#  228|->   info->sc = sc;
#  229|     info->lattice_node_list = (struct node_list_head*)
#  230|       malloc((size + 1) * sizeof(struct node_list_head));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/splitter.c: scope_hint: In function 'alloc_info_cache'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/splitter.c:135:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)(*sc.char_count + 1) * 4)'
#  133|     /* 各文字インデックスに対して初期化を行う */
#  134|     for (i = 0; i <= sc->char_count; i++) {
#  135|->     info->seq_len[i] = 0;
#  136|       info->rev_seq_len[i] = 0;
#  137|       info->cnode[i].wl = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/splitter.c:136:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)(*sc.char_count + 1) * 4)'
#  134|     for (i = 0; i <= sc->char_count; i++) {
#  135|       info->seq_len[i] = 0;
#  136|->     info->rev_seq_len[i] = 0;
#  137|       info->cnode[i].wl = NULL;
#  138|       info->cnode[i].mw = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-splitter/splitter.c:137:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc((long unsigned int)(*sc.char_count + 1) * 24)'
#  135|       info->seq_len[i] = 0;
#  136|       info->rev_seq_len[i] = 0;
#  137|->     info->cnode[i].wl = NULL;
#  138|       info->cnode[i].mw = NULL;
#  139|       info->cnode[i].max_len = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c: scope_hint: In function ‘encode_command_arg’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:164:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
/usr/include/sys/select.h:30: included_from: Included from here.
/usr/include/sys/time.h:32: included_from: Included from here.
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:16: included_from: Included from here.
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:23: included_from: Included from here.
#  162|     for(i = 0,j = 0; i < len; i++) {
#  163|       if (a[i] != '\\') {
#  164|->       s[j] = a[i];
#  165|         j++;
#  166|         continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:173:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
#  171|       case 0:
#  172|       case '\\':
#  173|->       s[j] = '\\';
#  174|         j++;
#  175|         break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:177:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
#  175|         break;
#  176|       case '\"':
#  177|->       s[j] = '\"';
#  178|         j++;
#  179|         break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def45]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:192:14: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘s’ where non-null expected
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#  190|   	p[0] = num & 255;
#  191|   	p[1] = num >> 8;
#  192|-> 	j += sprintf(&s[j], "%c%c", buf[1] , buf[0]);
#  193|         }
#  194|         break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:197:8: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘s’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
#  195|       }
#  196|     }
#  197|->   s[j] = 0;
#  198|   
#  199|     return s;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c: scope_hint: In function ‘make_command0’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:228:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cmd’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
#  226|   
#  227|     cmd = (struct command*) malloc(sizeof(struct command));
#  228|->   cmd->cmd = no;
#  229|     cmd->n_arg = 0;
#  230|     cmd->arg = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c: scope_hint: In function ‘make_command1’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:242:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cmd’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:22: included_from: Included from here.
#  240|   
#  241|     cmd = (struct command*) malloc(sizeof(struct command));
#  242|->   cmd->cmd = no;
#  243|     cmd->n_arg = 1;
#  244|     cmd->arg = (char**) malloc(sizeof(char*) * 1);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:245:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(8)’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
#  243|     cmd->n_arg = 1;
#  244|     cmd->arg = (char**) malloc(sizeof(char*) * 1);
#  245|->   cmd->arg[0] = strdup(arg1);
#  246|     cmd->next = NULL;
#  247|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def50]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c: scope_hint: In function ‘make_hl_command’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:360:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cmd’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:68:20: note: in definition of macro ‘MAX’
#  358|     /* コマンドを作る */
#  359|     cmd = (struct command*) malloc(sizeof(struct command));
#  360|->   cmd->cmd = cmdn->cmd;
#  361|     cmd->n_arg = cmdn->n_arg;
#  362|     if (cmd->n_arg > 0) {

Error: CPPCHECK_WARNING (CWE-457): [#def51]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/agent.c:637: error[uninitvar]: Uninitialized variable: buf
#  635|       if (q >= end) {
#  636|         *q = '\0';
#  637|->       write_reply(buf);
#  638|         q = buf;
#  639|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c: scope_hint: In function ‘open_typetab’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:136:5: warning[-Wanalyzer-malloc-leak]: leak of ‘fn’
#  134|     }
#  135|     if (!(tmp = realloc(fn, strlen(fn) + strlen(TYPETAB) + 4))) {
#  136|->     anthy_log(0, "Could not realloc TYPETAB.\n");
#  137|       /* free(fn) is freed twice. */
#  138|       return NULL;

Error: CPPCHECK_WARNING (CWE-415): [#def53]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:170: error[doubleFree]: Memory pointed to by 'fn' is freed twice.
#  168|          * CLANG_WARNING reports: 'fn' is freed twice.
#  169|          */
#  170|->       free(fn);
#  171|         return NULL;
#  172|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c: scope_hint: In function ‘read_typetab_entry’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:345:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘t’
#  343|     t = malloc(sizeof(struct trans_tab));
#  344|     sprintf(type_name, "#%s", buf);
#  345|->   t->type_name = strdup(type_name);
#  346|     t->var_list.next = 0;
#  347|     /* パラメータを読む */

Error: COMPILER_WARNING: [#def55]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c: scope_hint: In function ‘load_text_dic’
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:555:45: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
#  555 |       if (!(d = dict_head = calloc (sizeof (struct dict_entry), 1))) {
#      |                                             ^~~~~~
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:555:45: note: earlier argument should specify number of elements, later size of each element
#  553|       }
#  554|       if (!dict_head) {
#  555|->       if (!(d = dict_head = calloc (sizeof (struct dict_entry), 1))) {
#  556|           anthy_log(0, "Failed calloc in %s:%d\n", __FILE__, __LINE__);
#  557|           free(yomi);

Error: COMPILER_WARNING: [#def56]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:561:39: warning[-Wcalloc-transposed-args]: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument
#  561 |       if (!(d->next = calloc (sizeof (struct dict_entry), 1))) {
#      |                                       ^~~~~~
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/dic-tool.c:561:39: note: earlier argument should specify number of elements, later size of each element
#  559|         }
#  560|       } else {
#  561|->       if (!(d->next = calloc (sizeof (struct dict_entry), 1))) {
#  562|           anthy_log(0, "Failed calloc in %s:%d\n", __FILE__, __LINE__);
#  563|           free(yomi);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/input.c: scope_hint: In function 'ensure_buffer'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/input.c:114:10: warning[-Wanalyzer-malloc-leak]: leak of '*ictx.hbuf'
#  112|   {
#  113|     if (*size < to_size) {
#  114|->     *buf = (char*) realloc(*buf, to_size);
#  115|       if (*buf == NULL) {
#  116|         anthy_input_errno = AIE_NOMEM;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def58]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/input.c: scope_hint: In function 'enter_conv_state'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/input.c:270:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'as'
#  268|       struct a_segment* as;
#  269|       as = (struct a_segment*) malloc(sizeof(struct a_segment));
#  270|->     as->index = i;
#  271|       as->pos = last_pos;
#  272|       anthy_get_segment_stat(ictx->actx, i, &as->ass);

Error: GCC_ANALYZER_WARNING (CWE-465): [#def59]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/input.c: scope_hint: In function 'cmd_next_candidate'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-util/input.c:662:12: warning[-Wanalyzer-deref-before-check]: check of 'as' for NULL after already dereferencing it
#  660|   
#  661|     if (as->cand == NTH_UNCONVERTED_CANDIDATE) {
#  662|->     while (as) {
#  663|         if (as->cand == NTH_UNCONVERTED_CANDIDATE) {
#  664|   	as->cand = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c: scope_hint: In function 'pushback_place_name.part.0'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c:63:12: warning[-Wanalyzer-malloc-leak]: leak of 'zl.strs'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c: scope_hint: In function 'pushback_place_name.part.0'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c: scope_hint: In function 'pushback_place_name.part.0'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c: scope_hint: In function 'pushback_place_name.part.0'
#   61|       return ;
#   62|     }
#   63|->   zl->strs = realloc(zl->strs, sizeof(xstr *) * (zl->nr + 1));
#   64|     zl->strs[zl->nr] = anthy_cstr_to_xstr(pn, ANTHY_EUC_JP_ENCODING);
#   65|     zl->nr++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c:64:20: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/ext_ent.c: scope_hint: In function 'pushback_place_name.part.0'
#   62|     }
#   63|     zl->strs = realloc(zl->strs, sizeof(xstr *) * (zl->nr + 1));
#   64|->   zl->strs[zl->nr] = anthy_cstr_to_xstr(pn, ANTHY_EUC_JP_ENCODING);
#   65|     zl->nr++;
#   66|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def62]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c: scope_hint: In function 'init_lock_fn'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c:136:20: warning[-Wanalyzer-null-argument]: use of NULL 'home' where non-null expected
<built-in>: note: argument 1 of '__builtin_strlen' must be non-null
#  134|   init_lock_fn(const char *home, const char *id)
#  135|   {
#  136|->   lock_fn = malloc(strlen(home) + strlen(id) + 33);
#  137|     sprintf(lock_fn, "%s/lock-file_%s", home, id);
#  138|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def63]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c:137:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'lock_fn' where non-null expected
<built-in>: note: argument 1 of '__builtin_sprintf' must be non-null
#  135|   {
#  136|     lock_fn = malloc(strlen(home) + strlen(id) + 33);
#  137|->   sprintf(lock_fn, "%s/lock-file_%s", home, id);
#  138|   }
#  139|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def64]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c: scope_hint: In function 'open_tt_dic'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c:144:22: warning[-Wanalyzer-null-argument]: use of NULL 'home' where non-null expected
<built-in>: note: argument 1 of '__builtin_strlen' must be non-null
#  142|   {
#  143|     struct text_trie *tt;
#  144|->   char *buf = malloc(strlen(home) + strlen(id) + 33);
#  145|     sprintf(buf, "%s/private_dict_%s.tt", home, id);
#  146|     tt = anthy_trie_open(buf, 0);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def65]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c:145:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'buf' where non-null expected
<built-in>: note: argument 1 of '__builtin_sprintf' must be non-null
#  143|     struct text_trie *tt;
#  144|     char *buf = malloc(strlen(home) + strlen(id) + 33);
#  145|->   sprintf(buf, "%s/private_dict_%s.tt", home, id);
#  146|     tt = anthy_trie_open(buf, 0);
#  147|     free(buf);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def66]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c: scope_hint: In function 'open_textdic'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c:156:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'fn' where non-null expected
<built-in>: note: argument 1 of '__builtin_sprintf' must be non-null
#  154|     char *fn = malloc(strlen(home) + strlen(name) + strlen(id) + 2);
#  155|     struct textdict *td;
#  156|->   sprintf(fn, "%s/%s%s", home, name, id);
#  157|     td = anthy_textdict_open(fn);
#  158|     free(fn);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def67]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c: scope_hint: In function 'anthy_init_private_dic_option'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/priv_dic.c:498:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'imported_dic_dir' where non-null expected
<built-in>: note: argument 1 of '__builtin_sprintf' must be non-null
#  496|     imported_text_dic = open_textdic(home, "imported_words_", id);
#  497|     imported_dic_dir = malloc(strlen(home) + strlen(id) + 23);
#  498|->   sprintf(imported_dic_dir, "%s/imported_words_%s.d/", home, id);
#  499|     if (is_old) {
#  500|       old_anthy_private_tt_dic = tt_dic;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def68]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'do_select_section'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c:730:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'rsc'
#  728|     if (flag) {
#  729|       rsc = malloc(sizeof(struct record_section));
#  730|->     rsc->name = strdup(name);
#  731|       rsc->next = rst->section_list.next;
#  732|       rst->section_list.next = rsc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'get_nth_val_ent'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c:849:12: warning[-Wanalyzer-malloc-leak]: leak of '*rst_44(D)->cur_row.row.vals'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'get_nth_val_ent'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'get_nth_val_ent'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'get_nth_val_ent'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'get_nth_val_ent'
#  847|       }
#  848|       col->nr_vals = n + 1;
#  849|->     return &col->vals[n];
#  850|     }
#  851|     return NULL;

Error: CPPCHECK_WARNING (CWE-401): [#def70]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c:1048: error[memleakOnRealloc]: Common realloc mistake: 's' nulled but not freed upon failure
# 1046|       }
# 1047|   
# 1048|->     s = (char*) realloc(s, len + 2);
# 1049|       s[len] = c;
# 1050|       len ++;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def71]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'read_session'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c:1356:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'str' where non-null expected
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'read_session'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/record.c: scope_hint: In function 'read_session'
<built-in>: note: argument 1 of '__builtin_strlen' must be non-null
# 1354|   	char *str;
# 1355|   	str = strdup(&tokens[i][1]);
# 1356|-> 	str[strlen(str) - 1] = 0;
# 1357|   	xs = anthy_cstr_to_xstr(str, rst->encoding);
# 1358|   	free(str);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c: scope_hint: In function 'find_child'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c:1005:12: warning[-Wanalyzer-malloc-leak]: leak of 'parent_cell.u.body.obj'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c:57: included_from: Included from here.
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c: scope_hint: In function 'find_child'
/usr/include/string.h:33: included_from: Included from here.
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c:62: included_from: Included from here.
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c: scope_hint: In function 'find_child'
# 1003|   
# 1004|     if (!decode_nth_node(tt, &parent_cell, parent_idx)) {
# 1005|->     return 0;
# 1006|     }
# 1007|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c:1005:12: warning[-Wanalyzer-malloc-leak]: leak of 'parent_cell.u.tail.obj'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c: scope_hint: In function 'find_child'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/texttrie.c: scope_hint: In function 'find_child'
# 1003|   
# 1004|     if (!decode_nth_node(tt, &parent_cell, parent_idx)) {
# 1005|->     return 0;
# 1006|     }
# 1007|   

Error: CPPCHECK_WARNING (CWE-457): [#def74]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/word_dic.c:658: warning[uninitvar]: Uninitialized variable: elm
#  656|       off ++;
#  657|     }
#  658|->   return elm;
#  659|   }
#  660|   

Error: GCC_ANALYZER_WARNING (CWE-124): [#def75]
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/word_lookup.c: scope_hint: In function 'add_compound_ent'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/word_lookup.c:322:16: warning[-Wanalyzer-out-of-bounds]: stack-based buffer underwrite
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/word_lookup.c:38: included_from: Included from here.
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/word_lookup.c: scope_hint: In function 'add_compound_ent'
anthy-unicode-1.0.0.20240502-build/anthy-unicode-1.0.0.20240502/src-worddic/word_lookup.c: scope_hint: In function 'add_compound_ent'
#  320|   
#  321|     strncpy(buf, &ws->line[ws->offset + 1], len - 1);
#  322|->   buf[len - 1] = 0;
#  323|     xs = anthy_cstr_to_xstr(buf, ws->encoding);
#  324|   

Scan Properties

analyzer-version-clippy1.82.0
analyzer-version-cppcheck2.16.0
analyzer-version-gcc14.2.1
analyzer-version-gcc-analyzer15.0.0
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-161.us-west-2.compute.internal
mock-configfedora-rawhide-gcc-latest-x86_64
project-nameanthy-unicode-1.0.0.20240502-8.fc42
store-results-to/tmp/tmpt0ow4z02/anthy-unicode-1.0.0.20240502-8.fc42.tar.xz
time-created2024-11-12 23:12:34
time-finished2024-11-12 23:14:45
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpt0ow4z02/anthy-unicode-1.0.0.20240502-8.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpt0ow4z02/anthy-unicode-1.0.0.20240502-8.fc42.src.rpm'
tool-versioncsmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9