libcomps-0.1.21-1.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1]
libcomps-0.1.21/libcomps/src/comps_bradix.c: scope_hint: In function ‘comps_brtree_clone’
libcomps-0.1.21/libcomps/src/comps_bradix.c:173:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  171|   
#  172|           comps_hslist_destroy(&brtdata->subnodes);
#  173|->         brtdata->subnodes = ((COMPS_BRTreeData*)it->data)->subnodes;
#  174|           brtdata->data = new_data;
#  175|           comps_hslist_append(ret->subnodes, brtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def2]
libcomps-0.1.21/libcomps/src/comps_bradix.c:175:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  173|           brtdata->subnodes = ((COMPS_BRTreeData*)it->data)->subnodes;
#  174|           brtdata->data = new_data;
#  175|->         comps_hslist_append(ret->subnodes, brtdata, 0);
#  176|   
#  177|           comps_hslist_append(to_clone, brtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def3]
libcomps-0.1.21/libcomps/src/comps_bradix.c:182:42: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*to_clone.first’
#  180|       while (to_clone->first) {
#  181|           it2 = to_clone->first;
#  182|->         tmplist = ((COMPS_BRTreeData*)it2->data)->subnodes;
#  183|           comps_hslist_remove(to_clone, to_clone->first);
#  184|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def4]
libcomps-0.1.21/libcomps/src/comps_bradix.c:195:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  193|                   new_data = NULL;
#  194|               comps_hslist_destroy(&brtdata->subnodes);
#  195|->             brtdata->subnodes = ((COMPS_BRTreeData*)it->data)->subnodes;
#  196|               brtdata->data = new_data;
#  197|               comps_hslist_append(new_subnodes, brtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def5]
libcomps-0.1.21/libcomps/src/comps_bradix.c: scope_hint: In function ‘__comps_brtree_all’
libcomps-0.1.21/libcomps/src/comps_bradix.c:517:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  515|   
#  516|       pair = malloc(sizeof(struct Pair));
#  517|->     pair->subnodes = brt->subnodes;
#  518|       pair->key = NULL;
#  519|       pair->added = 0;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def6]
libcomps-0.1.21/libcomps/src/comps_bradix.c:534:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘**tmplist.first.data’
#  532|           it = tmplist->first;
#  533|           comps_hslist_remove(tmplist, tmplist->first);
#  534|->         tmp_subnodes = ((struct Pair*)it->data)->subnodes;
#  535|           parent_pair = (struct Pair*) it->data;
#  536|           free(it);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
libcomps-0.1.21/libcomps/src/comps_bradix.c:540:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  538|           for (it = tmp_subnodes->first; it != NULL; it=it->next) {
#  539|               pair = malloc(sizeof(struct Pair));
#  540|->             pair->subnodes = ((COMPS_BRTreeData*)it->data)->subnodes;
#  541|               pair->added = 0;
#  542|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
libcomps-0.1.21/libcomps/src/comps_bradix.c:556:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rtpair’
#  554|                   } else {
#  555|                       rtpair = malloc(sizeof(COMPS_BRTreePair));
#  556|->                     rtpair->key = pair->key;
#  557|                       rtpair->data = ((COMPS_BRTreeData*)it->data)->data;
#  558|                       rtpair->key_destroy = brt->key_destroy;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def9]
libcomps-0.1.21/libcomps/src/comps_doc.c: scope_hint: In function ‘comps_doc_listobjs_validate’
libcomps-0.1.21/libcomps/src/comps_doc.c:903:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘str’ where non-null expected
libcomps-0.1.21/libcomps/src/comps_doc.h:23: included_from: Included from here.
libcomps-0.1.21/libcomps/src/comps_doc.c:20: included_from: Included from here.
libcomps-0.1.21/libcomps/src/comps_doc.c:900:26: note: in expansion of macro ‘COMPS_OBJECT_CREATE’
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#  901|               }
#  902|               str = malloc(digits_count(x)*(sizeof(char)+2));
#  903|->             sprintf(str, "%zu.", x);
#  904|               comps_valgenres_prefix(tmpres, str);
#  905|               free(str);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
libcomps-0.1.21/libcomps/src/comps_docgroupid.c: scope_hint: In function ‘comps_docgroupid_str_u’
libcomps-0.1.21/libcomps/src/comps_docgroupid.c:97:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#   95|       char *def = ((COMPS_DocGroupId*)docgroupid)->def?"True":"False";
#   96|       char *ret = malloc(sizeof(char)*(len+strlen(name)+strlen(def)+1));
#   97|->     sprintf(ret, "<COMPS_DocGroupId name='%s' default='%s'>", name, def);
#   98|       free(name);
#   99|       return ret;

Error: CLANG_WARNING: [#def11]
libcomps-0.1.21/libcomps/src/comps_docgroupid.c:129:13: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
#  127|       } else if (groupid->def != default_def) {
#  128|           if (groupid->def)
#  129|->             ret = xmlTextWriterWriteAttribute(writer, BAD_CAST "default",
#  130|                                                 BAD_CAST "true");
#  131|           else

Error: CLANG_WARNING: [#def12]
libcomps-0.1.21/libcomps/src/comps_docgroupid.c:132:13: warning[deadcode.DeadStores]: Value stored to 'ret' is never read
#  130|                                                 BAD_CAST "true");
#  131|           else
#  132|->             ret = xmlTextWriterWriteAttribute(writer, BAD_CAST "default",
#  133|                                                 BAD_CAST "false");
#  134|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def13]
libcomps-0.1.21/libcomps/src/comps_log.c: scope_hint: In function ‘__comps_log_entry_prep’
libcomps-0.1.21/libcomps/src/comps_log.c:94:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘comps_log_entry_create()’
#   92|       entry = comps_log_entry_create();
#   93|   
#   94|->     entry->args = malloc(sizeof(COMPS_Object*) * n);
#   95|       entry->arg_count = n;
#   96|       entry->code = code;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def14]
libcomps-0.1.21/libcomps/src/comps_log.c: scope_hint: In function ‘__comps_log_entry’
libcomps-0.1.21/libcomps/src/comps_log.c:110:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown>.args + (long unsigned int)i * 8’
#  108|       for (int i=0; i<n; i++) {
#  109|           val = va_arg(va, COMPS_Object*);
#  110|->         entry->args[i] = comps_object_copy(val);
#  111|       }
#  112|       if (log->std_out) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def15]
libcomps-0.1.21/libcomps/src/comps_log.c: scope_hint: In function ‘__comps_log_entry_x’
libcomps-0.1.21/libcomps/src/comps_log.c:128:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown>.args + (long unsigned int)i * 8’
#  126|       for (int i=0; i<n; i++) {
#  127|           val = va_arg(va, COMPS_Object*);
#  128|->         entry->args[i] = val;
#  129|       }
#  130|       if (log->std_out) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def16]
libcomps-0.1.21/libcomps/src/comps_log.c: scope_hint: In function ‘__comps_log_entry_out’
libcomps-0.1.21/libcomps/src/comps_log.c:171:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘args’
#  169|   
#  170|       for (int i = 0; i < log_entry->arg_count; i++) {
#  171|->         args[i] = comps_object_tostr((COMPS_Object*)log_entry->args[i]);
#  172|           *total_len += strlen(args[i]);
#  173|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
libcomps-0.1.21/libcomps/src/comps_mradix.c: scope_hint: In function ‘__comps_mrtree_set’
libcomps-0.1.21/libcomps/src/comps_mradix.c:398:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  396|                       rtd = comps_mrtree_data_create(rt, rtdata->key+x, tmpdata);
#  397|                       comps_hslist_destroy(&rtd->subnodes);
#  398|->                     rtd->subnodes = tmpnodes;
#  399|                       comps_hslist_append(rtdata->subnodes, rtd, 0);
#  400|                       rtd = comps_mrtree_data_create(rt, key+offset+x, ndata);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
libcomps-0.1.21/libcomps/src/comps_mradix.c:407:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  405|                       rtd = comps_mrtree_data_create(rt, rtdata->key+x, tmpdata);
#  406|                       comps_hslist_destroy(&rtd->subnodes);
#  407|->                     rtd->subnodes = tmpnodes;
#  408|                       comps_hslist_append(rtdata->subnodes, rtd, 0);
#  409|                   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def19]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_object_create’
libcomps-0.1.21/libcomps/src/comps_obj.c:10:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘obj’
#    8|       COMPS_Object *obj;
#    9|       obj = malloc(obj_info->obj_size);
#   10|->     obj->obj_info = obj_info;
#   11|       obj->refc = comps_refc_create((void*)obj,
#   12|                                    (void (*)(void*)) obj_info->destructor);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def20]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_object_tostr’
libcomps-0.1.21/libcomps/src/comps_obj.c:69:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#   67|       } else {
#   68|           ret = malloc(sizeof(char));
#   69|->         ret[0]=0;
#   70|           return ret;;
#   71|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def21]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_num_tostr’
libcomps-0.1.21/libcomps/src/comps_obj.c:105:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#  103|           x = (int)(log10(((COMPS_Num*)num)->val)) + 1;
#  104|       ret = malloc(sizeof(char)*(x+1));
#  105|->     sprintf(ret, "%d", ((COMPS_Num*)num)->val);
#  106|       return ret;
#  107|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def22]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_str_create_u’
libcomps-0.1.21/libcomps/src/comps_obj.c:117:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*(COMPS_Str *)*args_10(D).val) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  115|           ((COMPS_Str*)str)->val = malloc(sizeof(char) *
#  116|                                           (strlen(((COMPS_Str*)args[0])->val)+1));
#  117|->         strcpy(((COMPS_Str*)str)->val, ((COMPS_Str*)args[0])->val);
#  118|       }
#  119|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def23]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_str_copy_u’
libcomps-0.1.21/libcomps/src/comps_obj.c:126:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*(COMPS_Str *)str_src.val) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  124|                         malloc(sizeof(char) *
#  125|                                (strlen(((COMPS_Str*)str_src)->val) + 1));
#  126|->         strcpy(((COMPS_Str*)str_dst)->val, ((COMPS_Str*)str_src)->val);
#  127|       } else
#  128|           ((COMPS_Str*)str_dst)->val = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def24]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_str_tostr’
libcomps-0.1.21/libcomps/src/comps_obj.c:139:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  137|       if (((COMPS_Str*)str)->val) {
#  138|           ret = malloc(sizeof(char)*(strlen(((COMPS_Str*)str)->val)+1));
#  139|->         strcpy(ret, ((COMPS_Str*)str)->val);
#  140|       } else {
#  141|           ret = malloc(sizeof(char));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def25]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_str_tostr.part.0’
libcomps-0.1.21/libcomps/src/comps_obj.c:142:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#  140|       } else {
#  141|           ret = malloc(sizeof(char));
#  142|->         ret[0] = 0;
#  143|       }
#  144|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def26]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_str’
libcomps-0.1.21/libcomps/src/comps_obj.c:167:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(s) + 1)’ where non-null expected
libcomps-0.1.21/libcomps/src/comps_obj.c:1: included_from: Included from here.
libcomps-0.1.21/libcomps/src/comps_obj.c:164:22: note: in expansion of macro ‘COMPS_OBJECT_CREATE’
libcomps-0.1.21/libcomps/src/comps_obj.c:164:22: note: in expansion of macro ‘COMPS_OBJECT_CREATE’
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  165|       if (s) {
#  166|           ret->val = malloc(sizeof(char) * ((strlen(s)+1)));
#  167|->         strcpy(ret->val, s);
#  168|       } else 
#  169|           ret->val = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
libcomps-0.1.21/libcomps/src/comps_obj.c: scope_hint: In function ‘comps_str_set’
libcomps-0.1.21/libcomps/src/comps_obj.c:180:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*str.val’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  178|       free(str->val);
#  179|       str->val = malloc(sizeof(char) * ((strlen(s)+1)));
#  180|->     strcpy(str->val, s);
#  181|   }
#  182|   signed char comps_str_fnmatch(COMPS_Str *str, char *pattern, int flags) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
libcomps-0.1.21/libcomps/src/comps_objlist.c: scope_hint: In function ‘__comps_objlist_append’
libcomps-0.1.21/libcomps/src/comps_objlist.c:144:9: warning[-Wanalyzer-malloc-leak]: leak of ‘comps_objlist_it_create(obj)’
#  142|   
#  143|   static int __comps_objlist_append(COMPS_ObjList *objlist, COMPS_ObjListIt *objit) {
#  144|->     if (!objlist || !objit) return 0;
#  145|       if (objlist->first == NULL) {
#  146|           objlist->first = objit;

Error: CLANG_WARNING: [#def29]
libcomps-0.1.21/libcomps/src/comps_objlist.c:162:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_it'
#  160|   int comps_objlist_append(COMPS_ObjList *objlist, COMPS_Object *obj) {
#  161|       COMPS_ObjListIt *new_it = comps_objlist_it_create(obj);
#  162|->     return __comps_objlist_append(objlist, new_it);
#  163|   }
#  164|   

Error: CPPCHECK_WARNING (CWE-476): [#def30]
libcomps-0.1.21/libcomps/src/comps_objlist.c:227: warning[nullPointer]: Possible null pointer dereference: oldit
#  225|               oldit = tmpit;
#  226|           }
#  227|->         newit->next = oldit->next;
#  228|           oldit->next = newit; 
#  229|       }

Error: CLANG_WARNING: [#def31]
libcomps-0.1.21/libcomps/src/comps_objlist.c:227:23: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'oldit')
#  225|               oldit = tmpit;
#  226|           }
#  227|->         newit->next = oldit->next;
#  228|           oldit->next = newit; 
#  229|       }

Error: CPPCHECK_WARNING (CWE-476): [#def32]
libcomps-0.1.21/libcomps/src/comps_objlist.c:228: warning[nullPointer]: Possible null pointer dereference: oldit
#  226|           }
#  227|           newit->next = oldit->next;
#  228|->         oldit->next = newit; 
#  229|       }
#  230|       objlist->len++;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def33]
libcomps-0.1.21/libcomps/src/comps_objlist.c: scope_hint: In function ‘comps_objlist_tostr_u’
libcomps-0.1.21/libcomps/src/comps_objlist.c:469:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#  467|       //total2=0;
#  468|       ret = malloc(sizeof(char) * (total_strlen));
#  469|->     ret[0]=0;
#  470|       strcat(ret, "[");
#  471|       //total2 += strlen("[");

Error: CLANG_WARNING: [#def34]
libcomps-0.1.21/libcomps/src/comps_objlist.c:474:13: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  472|       if (((COMPS_ObjList*)list)->len) {
#  473|           for (i = 0; i < (int)(((COMPS_ObjList*)list)->len-1); i++) {
#  474|->             strcat(ret, items[i]);
#  475|               //total2 += strlen(items[i]);
#  476|               strcat(ret, ", ");

Error: GCC_ANALYZER_WARNING (CWE-457): [#def35]
libcomps-0.1.21/libcomps/src/comps_objlist.c:474:30: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*items[i]’
#  472|       if (((COMPS_ObjList*)list)->len) {
#  473|           for (i = 0; i < (int)(((COMPS_ObjList*)list)->len-1); i++) {
#  474|->             strcat(ret, items[i]);
#  475|               //total2 += strlen(items[i]);
#  476|               strcat(ret, ", ");

Error: CLANG_WARNING: [#def36]
libcomps-0.1.21/libcomps/src/comps_objlist.c:480:9: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  478|               free(items[i]);
#  479|           }
#  480|->         strcat(ret, items[i]);
#  481|           //total2 += strlen(items[i]);
#  482|           free(items[i]);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def37]
libcomps-0.1.21/libcomps/src/comps_objlist.c:480:26: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*items[i]’
#  478|               free(items[i]);
#  479|           }
#  480|->         strcat(ret, items[i]);
#  481|           //total2 += strlen(items[i]);
#  482|           free(items[i]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
libcomps-0.1.21/libcomps/src/comps_objmradix.c: scope_hint: In function ‘__comps_objmrtree_set’
libcomps-0.1.21/libcomps/src/comps_objmradix.c:436:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  434|                                                         (COMPS_Object*)tmpdata);
#  435|                       comps_hslist_destroy(&rtd->subnodes);
#  436|->                     rtd->subnodes = tmphslist;
#  437|   
#  438|                       comps_hslist_append(rtdata->subnodes, rtd, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
libcomps-0.1.21/libcomps/src/comps_objmradix.c:450:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  448|                                                        (COMPS_Object*)tmpdata);
#  449|                       comps_hslist_destroy(&rtd->subnodes);
#  450|->                     rtd->subnodes = tmphslist;
#  451|                       comps_hslist_append(rtdata->subnodes, rtd, 0);
#  452|                   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def40]
libcomps-0.1.21/libcomps/src/comps_objmradix.c: scope_hint: In function ‘__comps_objmrtree_all’
libcomps-0.1.21/libcomps/src/comps_objmradix.c:632:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  630|       for (hsit = rt->subnodes->first; hsit != NULL; hsit = hsit->next) {
#  631|           pair = malloc(sizeof(struct Pair));
#  632|->         pair->key = __comps_strcpy(((COMPS_ObjMRTreeData*)hsit->data)->key);
#  633|           pair->data = ((COMPS_ObjMRTreeData*)hsit->data)->data;
#  634|           pair->subnodes = ((COMPS_ObjMRTreeData*)hsit->data)->subnodes;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def41]
libcomps-0.1.21/libcomps/src/comps_objmradix.c:639:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*to_process.first’
#  637|       while (to_process->first) {
#  638|           //oldpair = current_pair;
#  639|->         current_pair = to_process->first->data;
#  640|           oldit = to_process->first;
#  641|           comps_hslist_remove(to_process, to_process->first);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def42]
libcomps-0.1.21/libcomps/src/comps_objmradix.c:642:25: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘current_pair’
#  640|           oldit = to_process->first;
#  641|           comps_hslist_remove(to_process, to_process->first);
#  642|->         if (current_pair->data) {
#  643|               if (keyvalpair == 0) {
#  644|                   comps_hslist_append(ret, __comps_strcpy(current_pair->key), 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
libcomps-0.1.21/libcomps/src/comps_objmradix.c:649:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rtpair’
#  647|               } else {
#  648|                   rtpair = malloc(sizeof(COMPS_ObjMRTreePair));
#  649|->                 rtpair->key = __comps_strcpy(current_pair->key);
#  650|                   rtpair->data = current_pair->data;
#  651|                   comps_hslist_append(ret, rtpair, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def44]
libcomps-0.1.21/libcomps/src/comps_objmradix.c:657:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  655|                hsit != NULL; hsit = hsit->next, x++) {
#  656|               pair = malloc(sizeof(struct Pair));
#  657|->             pair->key = __comps_strcat(current_pair->key,
#  658|                                          ((COMPS_ObjMRTreeData*)hsit->data)->key);
#  659|               pair->data = ((COMPS_ObjMRTreeData*)hsit->data)->data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
libcomps-0.1.21/libcomps/src/comps_objradix.c: scope_hint: In function ‘comps_objrtree_clone’
libcomps-0.1.21/libcomps/src/comps_objradix.c:114:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  112|               new_data = NULL;
#  113|           comps_hslist_destroy(&rtdata->subnodes);
#  114|->         rtdata->subnodes = ((COMPS_ObjRTreeData*)it->data)->subnodes;
#  115|           rtdata->data = new_data;
#  116|           comps_hslist_append(ret->subnodes, rtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
libcomps-0.1.21/libcomps/src/comps_objradix.c:135:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  133|                   new_data = NULL;
#  134|               comps_hslist_destroy(&rtdata->subnodes);
#  135|->             rtdata->subnodes = ((COMPS_ObjRTreeData*)it->data)->subnodes;
#  136|               rtdata->data = new_data;
#  137|               comps_hslist_append(new_subnodes, rtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
libcomps-0.1.21/libcomps/src/comps_objradix.c: scope_hint: In function ‘__comps_objrtree_set’
libcomps-0.1.21/libcomps/src/comps_objradix.c:424:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  422|                       rtd = comps_objrtree_data_create(rtdata->key+x, tmpdata);
#  423|                       comps_hslist_destroy(&rtd->subnodes);
#  424|->                     rtd->subnodes = tmphslist;
#  425|   
#  426|                       comps_hslist_append(rtdata->subnodes,rtd, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
libcomps-0.1.21/libcomps/src/comps_objradix.c:435:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  433|                       rtd = comps_objrtree_data_create(rtdata->key+x, tmpdata);
#  434|                       comps_hslist_destroy(&rtd->subnodes);
#  435|->                     rtd->subnodes = tmphslist;
#  436|                       comps_hslist_append(rtdata->subnodes, rtd, 0);
#  437|                   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
libcomps-0.1.21/libcomps/src/comps_objradix.c: scope_hint: In function ‘__comps_objrtree_all’
libcomps-0.1.21/libcomps/src/comps_objradix.c:643:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  641|       for (hsit = rt->subnodes->first; hsit != NULL; hsit = hsit->next) {
#  642|           pair = malloc(sizeof(struct Pair));
#  643|->         pair->key = __comps_strcpy(((COMPS_ObjRTreeData*)hsit->data)->key);
#  644|           pair->data = ((COMPS_ObjRTreeData*)hsit->data)->data;
#  645|           pair->subnodes = ((COMPS_ObjRTreeData*)hsit->data)->subnodes;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def50]
libcomps-0.1.21/libcomps/src/comps_objradix.c:650:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*to_process.first’
#  648|       while (to_process->first) {
#  649|           //oldpair = current_pair;
#  650|->         current_pair = to_process->first->data;
#  651|           oldit = to_process->first;
#  652|           comps_hslist_remove(to_process, to_process->first);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def51]
libcomps-0.1.21/libcomps/src/comps_objradix.c:653:25: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘current_pair’
#  651|           oldit = to_process->first;
#  652|           comps_hslist_remove(to_process, to_process->first);
#  653|->         if (current_pair->data) {
#  654|               if (keyvalpair == 0) {
#  655|                   comps_hslist_append(ret, __comps_strcpy(current_pair->key), 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
libcomps-0.1.21/libcomps/src/comps_objradix.c:660:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rtpair’
#  658|               } else {
#  659|                   rtpair = malloc(sizeof(COMPS_ObjRTreePair));
#  660|->                 rtpair->key = __comps_strcpy(current_pair->key);
#  661|                   rtpair->data = current_pair->data;
#  662|                   comps_hslist_append(ret, rtpair, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
libcomps-0.1.21/libcomps/src/comps_objradix.c:668:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  666|                hsit != NULL; hsit = hsit->next, x++) {
#  667|               pair = malloc(sizeof(struct Pair));
#  668|->             pair->key = __comps_strcat(current_pair->key,
#  669|                                          ((COMPS_ObjRTreeData*)hsit->data)->key);
#  670|               pair->data = ((COMPS_ObjRTreeData*)hsit->data)->data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
libcomps-0.1.21/libcomps/src/comps_objradix.c: scope_hint: In function ‘comps_objrtree_unite’
libcomps-0.1.21/libcomps/src/comps_objradix.c:692:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  690|   
#  691|       pair = malloc(sizeof(struct Pair));
#  692|->     pair->subnodes = rt2->subnodes;
#  693|       pair->key = NULL;
#  694|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def55]
libcomps-0.1.21/libcomps/src/comps_objradix.c:702:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘**tmplist.first.data’
#  700|           it = tmplist->first;
#  701|           comps_hslist_remove(tmplist, tmplist->first);
#  702|->         tmp_subnodes = ((struct Pair*)it->data)->subnodes;
#  703|           parent_pair = (struct Pair*) it->data;
#  704|           //printf("key-part:%s\n", parent_pair->key);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def56]
libcomps-0.1.21/libcomps/src/comps_objradix.c:709:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  707|           for (it = tmp_subnodes->first; it != NULL; it=it->next) {
#  708|               pair = malloc(sizeof(struct Pair));
#  709|->             pair->subnodes = ((COMPS_ObjRTreeData*)it->data)->subnodes;
#  710|   
#  711|               if (parent_pair->key != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def57]
libcomps-0.1.21/libcomps/src/comps_objradix.c:715:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*(COMPS_ObjRTreeData *)it_43->data.key) + strlen(*(struct Pair *)_42->data.key) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  713|                                  * (strlen(((COMPS_ObjRTreeData*)it->data)->key)
#  714|                                  + strlen(parent_pair->key) + 1));
#  715|->                 memcpy(pair->key, parent_pair->key,
#  716|                          sizeof(char) * strlen(parent_pair->key));
#  717|                   memcpy(pair->key + strlen(parent_pair->key),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def58]
libcomps-0.1.21/libcomps/src/comps_objradix.c:723:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*(COMPS_ObjRTreeData *)it_43->data.key) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  721|                   pair->key = malloc(sizeof(char)*
#  722|                                   (strlen(((COMPS_ObjRTreeData*)it->data)->key) +1));
#  723|->                 memcpy(pair->key, ((COMPS_ObjRTreeData*)it->data)->key,
#  724|                          sizeof(char)*(strlen(((COMPS_ObjRTreeData*)it->data)->key)+1));
#  725|               }

Error: COMPILER_WARNING (CWE-563): [#def59]
libcomps-0.1.21/libcomps/src/comps_parse.c: scope_hint: In function ‘comps_parse_start_doctype’
libcomps-0.1.21/libcomps/src/comps_parse.c:133:36: warning[-Wunused-parameter]: unused parameter ‘standalone’
#  133 |                                int standalone) {
#      |                                ~~~~^~~~~~~~~~
#  131|                                  const XML_Char *sysid,
#  132|                                  const XML_Char *pubid,
#  133|->                                int standalone) {
#  134|       #define parsed ((COMPS_Parsed*)userData)
#  135|       parsed->doctype_name = comps_str(doctypeName);

Error: COMPILER_WARNING (CWE-704): [#def60]
libcomps-0.1.21/libcomps/src/comps_parse.c: scope_hint: In function ‘comps_parse_validate_dtd’
libcomps-0.1.21/libcomps/src/comps_parse.c:168:13: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  168 |         err = xmlGetLastError();
#      |             ^
#  166|       ret = xmlValidateDtd(vctxt, fptr, dtd_ptr);
#  167|       if (!ret) {
#  168|->         err = xmlGetLastError();
#  169|           printf("%s\n", err->message);
#  170|           ret = -err->code;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def61]
libcomps-0.1.21/libcomps/src/comps_parse.c: scope_hint: In function ‘comps_parse_end_elem_handler’
libcomps-0.1.21/libcomps/src/comps_parse.c:293:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘alltext’
#  291|               raise(SIGABRT);
#  292|           }
#  293|->         alltext[0]=0;
#  294|       }
#  295|       while ((data = comps_hslist_shift(parsed->text_buffer)) != NULL) {

Error: CLANG_WARNING: [#def62]
libcomps-0.1.21/libcomps/src/comps_parse.c:293:19: warning[core.NullDereference]: Array access (from variable 'alltext') results in a null pointer dereference
#  291|               raise(SIGABRT);
#  292|           }
#  293|->         alltext[0]=0;
#  294|       }
#  295|       while ((data = comps_hslist_shift(parsed->text_buffer)) != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def63]
libcomps-0.1.21/libcomps/src/comps_parse.c:297:19: warning[-Wanalyzer-null-argument]: use of NULL ‘alltext’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcat’ must be non-null
#  295|       while ((data = comps_hslist_shift(parsed->text_buffer)) != NULL) {
#  296|           //item_len = strlen((char*)data);
#  297|->         alltext = strcat(alltext, data);
#  298|           free(data);
#  299|           //index += item_len;

Error: CLANG_WARNING: [#def64]
libcomps-0.1.21/libcomps/src/comps_parse.c:297:19: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  295|       while ((data = comps_hslist_shift(parsed->text_buffer)) != NULL) {
#  296|           //item_len = strlen((char*)data);
#  297|->         alltext = strcat(alltext, data);
#  298|           free(data);
#  299|           //index += item_len;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def65]
libcomps-0.1.21/libcomps/src/comps_parse.c: scope_hint: In function ‘comps_parse_check_attributes’
libcomps-0.1.21/libcomps/src/comps_parse.c:449:33: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘it’
#  447|       for (int x =0; x<attr_count; x++) {
#  448|           for (COMPS_HSListItem *it = keys->first; it != NULL; it = it->next) {
#  449|->             if (strcmp((char*)it->data, info->attributes[x]->name) == 0) {
#  450|                   if (info->attributes[x]->val_check) {
#  451|                       val = comps_dict_get(elem->attrs, it->data);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def66]
libcomps-0.1.21/libcomps/src/comps_parse.c:466:41: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘it’
#  464|       for (COMPS_HSListItem *it = keys->first; it != NULL; it = it->next) {
#  465|           comps_log_warning_x(parsed->log, COMPS_ERR_ATTR_UNKNOWN, 4,
#  466|->                             comps_str(it->data), comps_str(info->name),
#  467|                               comps_num(XML_GetCurrentLineNumber(parsed->parser)),
#  468|                               comps_num(XML_GetCurrentColumnNumber(parsed->parser)));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
libcomps-0.1.21/libcomps/src/comps_radix.c: scope_hint: In function ‘comps_rtree_clone’
libcomps-0.1.21/libcomps/src/comps_radix.c:129:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  127|               new_data = NULL;
#  128|           comps_hslist_destroy(&rtdata->subnodes);
#  129|->         rtdata->subnodes = ((COMPS_RTreeData*)it->data)->subnodes;
#  130|           rtdata->data = new_data;
#  131|           comps_hslist_append(ret->subnodes, rtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def68]
libcomps-0.1.21/libcomps/src/comps_radix.c:131:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  129|           rtdata->subnodes = ((COMPS_RTreeData*)it->data)->subnodes;
#  130|           rtdata->data = new_data;
#  131|->         comps_hslist_append(ret->subnodes, rtdata, 0);
#  132|   
#  133|           comps_hslist_append(to_clone, rtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def69]
libcomps-0.1.21/libcomps/src/comps_radix.c:139:41: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*to_clone.first’
#  137|       while (to_clone->first) {
#  138|           it2 = to_clone->first;
#  139|->         tmplist = ((COMPS_RTreeData*)it2->data)->subnodes;
#  140|           comps_hslist_remove(to_clone, to_clone->first);
#  141|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
libcomps-0.1.21/libcomps/src/comps_radix.c:152:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  150|                   new_data = NULL;
#  151|               comps_hslist_destroy(&rtdata->subnodes);
#  152|->             rtdata->subnodes = ((COMPS_RTreeData*)it->data)->subnodes;
#  153|               rtdata->data = new_data;
#  154|               comps_hslist_append(new_subnodes, rtdata, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def71]
libcomps-0.1.21/libcomps/src/comps_radix.c: scope_hint: In function ‘__comps_rtree_set’
libcomps-0.1.21/libcomps/src/comps_radix.c:201:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rt’
#  199|       char ended;//, tmpch;
#  200|   
#  201|->     if (rt->subnodes == NULL)
#  202|           return;
#  203|       if (rt->data_constructor) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def72]
libcomps-0.1.21/libcomps/src/comps_radix.c:275:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  273|                       rtd = comps_rtree_data_create(rt, rtdata->key+x, tmpdata);
#  274|                       comps_hslist_destroy(&rtd->subnodes);
#  275|->                     rtd->subnodes = tmpnodes;
#  276|                       comps_hslist_append(rtdata->subnodes, rtd, 0);
#  277|                       rtd = comps_rtree_data_create(rt, key+offset+x, ndata);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def73]
libcomps-0.1.21/libcomps/src/comps_radix.c:284:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  282|                       rtd = comps_rtree_data_create(rt, rtdata->key+x, tmpdata);
#  283|                       comps_hslist_destroy(&rtd->subnodes);
#  284|->                     rtd->subnodes = tmpnodes;
#  285|                       comps_hslist_append(rtdata->subnodes, rtd, 0);
#  286|                   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def74]
libcomps-0.1.21/libcomps/src/comps_radix.c: scope_hint: In function ‘__comps_rtree_all’
libcomps-0.1.21/libcomps/src/comps_radix.c:486:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  484|       for (hsit = rt->subnodes->first; hsit != NULL; hsit = hsit->next) {
#  485|           pair = malloc(sizeof(struct Pair));
#  486|->         pair->key = __comps_strcpy(((COMPS_RTreeData*)hsit->data)->key);
#  487|           pair->data = ((COMPS_RTreeData*)hsit->data)->data;
#  488|           pair->subnodes = ((COMPS_RTreeData*)hsit->data)->subnodes;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def75]
libcomps-0.1.21/libcomps/src/comps_radix.c:493:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*to_process.first’
#  491|       while (to_process->first) {
#  492|           //oldpair = current_pair;
#  493|->         current_pair = to_process->first->data;
#  494|           oldit = to_process->first;
#  495|           comps_hslist_remove(to_process, to_process->first);

Error: GCC_ANALYZER_WARNING (CWE-416): [#def76]
libcomps-0.1.21/libcomps/src/comps_radix.c:496:25: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘current_pair’
#  494|           oldit = to_process->first;
#  495|           comps_hslist_remove(to_process, to_process->first);
#  496|->         if (current_pair->data) {
#  497|               if (keyvalpair == 0) {
#  498|                   comps_hslist_append(ret, __comps_strcpy(current_pair->key), 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def77]
libcomps-0.1.21/libcomps/src/comps_radix.c:503:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘rtpair’
#  501|               } else {
#  502|                   rtpair = malloc(sizeof(COMPS_RTreePair));
#  503|->                 rtpair->key = __comps_strcpy(current_pair->key);
#  504|                   rtpair->data = current_pair->data;
#  505|                   comps_hslist_append(ret, rtpair, 0);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def78]
libcomps-0.1.21/libcomps/src/comps_radix.c:511:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  509|                hsit != NULL; hsit = hsit->next, x++) {
#  510|               pair = malloc(sizeof(struct Pair));
#  511|->             pair->key = __comps_strcat(current_pair->key,
#  512|                                          ((COMPS_RTreeData*)hsit->data)->key);
#  513|               pair->data = ((COMPS_RTreeData*)hsit->data)->data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def79]
libcomps-0.1.21/libcomps/src/comps_radix.c: scope_hint: In function ‘comps_rtree_unite’
libcomps-0.1.21/libcomps/src/comps_radix.c:535:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  533|   
#  534|       pair = malloc(sizeof(struct Pair));
#  535|->     pair->subnodes = rt2->subnodes;
#  536|       pair->key = NULL;
#  537|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def80]
libcomps-0.1.21/libcomps/src/comps_radix.c:545:22: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘**tmplist.first.data’
#  543|           it = tmplist->first;
#  544|           comps_hslist_remove(tmplist, tmplist->first);
#  545|->         tmp_subnodes = ((struct Pair*)it->data)->subnodes;
#  546|           parent_pair = (struct Pair*) it->data;
#  547|           free(it);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def81]
libcomps-0.1.21/libcomps/src/comps_radix.c:551:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pair’
#  549|           for (it = tmp_subnodes->first; it != NULL; it=it->next) {
#  550|               pair = malloc(sizeof(struct Pair));
#  551|->             pair->subnodes = ((COMPS_RTreeData*)it->data)->subnodes;
#  552|   
#  553|               if (parent_pair->key != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def82]
libcomps-0.1.21/libcomps/src/comps_radix.c:557:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*(COMPS_RTreeData *)it_44->data.key) + strlen(*(struct Pair *)_43->data.key) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  555|                                  * (strlen(((COMPS_RTreeData*)it->data)->key)
#  556|                                  + strlen(parent_pair->key) + 1));
#  557|->                 memcpy(pair->key, parent_pair->key,
#  558|                          sizeof(char) * strlen(parent_pair->key));
#  559|                   memcpy(pair->key + strlen(parent_pair->key),

Error: GCC_ANALYZER_WARNING (CWE-688): [#def83]
libcomps-0.1.21/libcomps/src/comps_radix.c:565:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*(COMPS_RTreeData *)it_44->data.key) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  563|                   pair->key = malloc(sizeof(char)*
#  564|                                   (strlen(((COMPS_RTreeData*)it->data)->key) +1));
#  565|->                 memcpy(pair->key, ((COMPS_RTreeData*)it->data)->key,
#  566|                          sizeof(char)*(strlen(((COMPS_RTreeData*)it->data)->key)+1));
#  567|               }

Error: GCC_ANALYZER_WARNING (CWE-415): [#def84]
libcomps-0.1.21/libcomps/src/comps_radix.c:581:9: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*(struct Pair *)_43->data.key’
#  579|               }
#  580|           }
#  581|->         free(parent_pair->key);
#  582|           free(parent_pair);
#  583|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def85]
libcomps-0.1.21/libcomps/src/comps_set.c:132:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘not_processed1’
libcomps-0.1.21/libcomps/src/comps_set.c: scope_hint: In function ‘comps_set_cmp’
#  130|   
#  131|   inline char comps_set_is_empty(COMPS_Set *set) {
#  132|->     if (set->data->first == NULL) {
#  133|           return 1;
#  134|       } else return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
libcomps-0.1.21/libcomps/src/comps_set.c:132:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘not_processed2’
libcomps-0.1.21/libcomps/src/comps_set.c: scope_hint: In function ‘comps_set_cmp’
libcomps-0.1.21/libcomps/src/comps_set.c: scope_hint: In function ‘comps_set_cmp’
#  130|   
#  131|   inline char comps_set_is_empty(COMPS_Set *set) {
#  132|->     if (set->data->first == NULL) {
#  133|           return 1;
#  134|       } else return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
libcomps-0.1.21/libcomps/src/comps_set.c: scope_hint: In function ‘comps_set_cmp’
libcomps-0.1.21/libcomps/src/comps_set.c:154:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘not_processed1’
#  152|                                      &free, &comps_set_index_cmp);
#  153|       for (x = 0, it = set1->data->first; it!= NULL; it = it->next, x++) {
#  154|->         comps_hslist_append(not_processed1->data, &x, 1);
#  155|       }
#  156|       for (x = 0, it = set2->data->first; it!= NULL; it = it->next, x++) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
libcomps-0.1.21/libcomps/src/comps_set.c:157:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘not_processed1’
#  155|       }
#  156|       for (x = 0, it = set2->data->first; it!= NULL; it = it->next, x++) {
#  157|->         comps_hslist_append(not_processed2->data, &x, 1);
#  158|       }
#  159|       it = set1->data->first;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def89]
libcomps-0.1.21/libcomps/src/comps_set.c:157:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘not_processed2’
#  155|       }
#  156|       for (x = 0, it = set2->data->first; it!= NULL; it = it->next, x++) {
#  157|->         comps_hslist_append(not_processed2->data, &x, 1);
#  158|       }
#  159|       it = set1->data->first;

Error: CLANG_WARNING: [#def90]
libcomps-0.1.21/libcomps/src/comps_set.c:165:38: warning[core.NullDereference]: Access to field 'data' results in a dereference of a null pointer (loaded from variable 'it')
#  163|       while (!comps_set_is_empty(not_processed1) &&
#  164|              !comps_set_is_empty(not_processed2)) {
#  165|->         if ((at = comps_set_at(set2, it->data)) != -1) {
#  166|               item = comps_set_remove(not_processed1, (void*)&index);
#  167|               free(item);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
libcomps-0.1.21/libcomps/src/comps_utils.c: scope_hint: In function ‘__comps_num2boolstr’
libcomps-0.1.21/libcomps/src/comps_utils.c:57:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#   55|       }
#   56|       ret = malloc(sizeof(char) * (strlen(_bool)+1));
#   57|->     ret[0] = 0;
#   58|       strcat(ret, _bool);
#   59|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
libcomps-0.1.21/libcomps/src/comps_utils.c: scope_hint: In function ‘__comps_xml_arch_str’
libcomps-0.1.21/libcomps/src/comps_utils.c:93:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘arches_str’
#   91|       if (!archlist || !((COMPS_ObjList*)archlist)->len) {
#   92|           arches_str = malloc(sizeof(char));
#   93|->         arches_str[0] = 0;
#   94|           return arches_str;
#   95|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
libcomps-0.1.21/libcomps/src/comps_utils.c:103:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘arches_str’
#  101|       }
#  102|       arches_str = malloc(sizeof(char) * (total_len));
#  103|->     arches_str[0]=0;
#  104|   
#  105|       x = 0;

Error: CLANG_WARNING: [#def94]
libcomps-0.1.21/libcomps/src/comps_utils.c:103:18: warning[unix.Malloc]: Use of memory allocated with size zero
#  101|       }
#  102|       arches_str = malloc(sizeof(char) * (total_len));
#  103|->     arches_str[0]=0;
#  104|   
#  105|       x = 0;

Error: CLANG_WARNING: [#def95]
libcomps-0.1.21/libcomps/src/comps_utils.c:107:9: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  105|       x = 0;
#  106|       for (; x < (size_t)(((COMPS_ObjList*)archlist)->len-1); x++) {
#  107|->         strcat(arches_str, arches[x]);
#  108|           free(arches[x]);
#  109|           strcat(arches_str, " ");

Error: CLANG_WARNING: [#def96]
libcomps-0.1.21/libcomps/src/comps_utils.c:111:5: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  109|           strcat(arches_str, " ");
#  110|       }
#  111|->     strcat(arches_str, arches[x]);
#  112|       free(arches[x]);
#  113|       return arches_str;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def97]
libcomps-0.1.21/libcomps/src/comps_utils.c: scope_hint: In function ‘__comps_strcpy’
libcomps-0.1.21/libcomps/src/comps_utils.c:130:12: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  128|       char *ret;
#  129|       ret = malloc(sizeof(char)*(strlen(str)+1));
#  130|->     return memcpy(ret, str, sizeof(char)*(strlen(str)+1));
#  131|   }
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def98]
libcomps-0.1.21/libcomps/src/comps_utils.c: scope_hint: In function ‘__comps_strcat’
libcomps-0.1.21/libcomps/src/comps_utils.c:136:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  134|       char *ret;
#  135|       ret = malloc(sizeof(char)*(strlen(str1)+strlen(str2)+1));
#  136|->     memcpy(ret, str1, sizeof(char)*(strlen(str1)+1));
#  137|       strcat(ret, str2);
#  138|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def99]
libcomps-0.1.21/libcomps/src/comps_validate.c: scope_hint: In function ‘comps_valgenres_prefix.part.0’
libcomps-0.1.21/libcomps/src/comps_validate.c:59:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 2 of ‘__builtin_memmove’ must be non-null
#   57|                                         (oldlen + strlen(prefix) +1) *
#   58|                                         sizeof(char));
#   59|->         memmove(((COMPS_ValErr*)it->comps_obj)->err_msg + (strlen(prefix) *sizeof(char)),
#   60|                   ((COMPS_ValErr*)it->comps_obj)->err_msg, (oldlen+1) * sizeof(char));
#   61|           memcpy(((COMPS_ValErr*)it->comps_obj)->err_msg, prefix,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def100]
libcomps-0.1.21/libcomps/src/comps_validate.c: scope_hint: In function ‘comps_objlist_unique_check’
libcomps-0.1.21/libcomps/src/comps_validate.c:195:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘msg’ where non-null expected
libcomps-0.1.21/libcomps/src/comps_validate.h:4: included_from: Included from here.
libcomps-0.1.21/libcomps/src/comps_validate.c:1: included_from: Included from here.
libcomps-0.1.21/libcomps/src/comps_validate.c:186:47: note: in expansion of macro ‘COMPS_OBJECT_CREATE’
<built-in>: note: argument 1 of ‘__builtin_sprintf’ must be non-null
#  193|               msg = malloc(sizeof(char) * (strlen(msg_fmt)-3)+digits_count(x)\
#  194|                                                              +digits_count(index));
#  195|->             sprintf(msg, msg_fmt, index, x);
#  196|               v_err->err_msg = msg;
#  197|               comps_objlist_append_x(((COMPS_ValErrResult*)valres)->err_list,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c: scope_hint: In function ‘__pycomps_dict_to_xml_opts’
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:60:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(15)’
#   58|                         &(*options)->bao_explicit,
#   59|                         &(*options)->arch_output};
#   60|->     **options = COMPS_XMLDefaultOptions;
#   61|   
#   62|       if (!PyDict_Check(pobj)) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c: scope_hint: In function ‘__pycomps_dict_to_def_opts’
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:92:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(8)’
#   90|                         &(*options)->default_default};
#   91|       int *props1[] = {&(*options)->default_pkgtype};
#   92|->     **options = COMPS_DDefaultsOptions;
#   93|   
#   94|       if (!PyDict_Check(pobj)) {

Error: COMPILER_WARNING (CWE-843): [#def103]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:775:22: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  775 |     {"groups_match", (PyCFunction)PyCOMPS_groups_match, METH_VARARGS | METH_KEYWORDS,
#      |                      ^
#  773|   
#  774|   static PyMethodDef PyCOMPS_methods[] = {
#  775|->     {"groups_match", (PyCFunction)PyCOMPS_groups_match, METH_VARARGS | METH_KEYWORDS,
#  776|       PyCOMPS_validate__doc__},
#  777|       {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def104]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:777:26: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  777 |     {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_VARARGS | METH_KEYWORDS,
#      |                          ^
#  775|       {"groups_match", (PyCFunction)PyCOMPS_groups_match, METH_VARARGS | METH_KEYWORDS,
#  776|       PyCOMPS_validate__doc__},
#  777|->     {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_VARARGS | METH_KEYWORDS,
#  778|       PyCOMPS_validate__doc__},
#  779|       {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def105]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:779:28: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  779 |     {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_VARARGS | METH_KEYWORDS,
#      |                            ^
#  777|       {"categories_match", (PyCFunction)PyCOMPS_categories_match, METH_VARARGS | METH_KEYWORDS,
#  778|       PyCOMPS_validate__doc__},
#  779|->     {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_VARARGS | METH_KEYWORDS,
#  780|       PyCOMPS_validate__doc__},
#  781|       {"validate", (PyCFunction)PyCOMPS_validate, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def106]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:781:18: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS *)’ {aka ‘struct _object * (*)(PyCOMPS *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  781 |     {"validate", (PyCFunction)PyCOMPS_validate, METH_NOARGS,
#      |                  ^
#  779|       {"environments_match", (PyCFunction)PyCOMPS_envs_match, METH_VARARGS | METH_KEYWORDS,
#  780|       PyCOMPS_validate__doc__},
#  781|->     {"validate", (PyCFunction)PyCOMPS_validate, METH_NOARGS,
#  782|       PyCOMPS_validate__doc__},
#  783|       {"validate_nf", (PyCFunction)PyCOMPS_validate_nf, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def107]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:783:21: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS *)’ {aka ‘struct _object * (*)(PyCOMPS *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  783 |     {"validate_nf", (PyCFunction)PyCOMPS_validate_nf, METH_NOARGS,
#      |                     ^
#  781|       {"validate", (PyCFunction)PyCOMPS_validate, METH_NOARGS,
#  782|       PyCOMPS_validate__doc__},
#  783|->     {"validate_nf", (PyCFunction)PyCOMPS_validate_nf, METH_NOARGS,
#  784|       PyCOMPS_validate_nf__doc__},
#  785|       {"xml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def108]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:785:15: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  785 |     {"xml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,
#      |               ^
#  783|       {"validate_nf", (PyCFunction)PyCOMPS_validate_nf, METH_NOARGS,
#  784|       PyCOMPS_validate_nf__doc__},
#  785|->     {"xml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,
#  786|       PyCOMPS_xml_f__doc__},
#  787|       {"xml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def109]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:787:17: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  787 |     {"xml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,
#      |                 ^
#  785|       {"xml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,
#  786|       PyCOMPS_xml_f__doc__},
#  787|->     {"xml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,
#  788|       PyCOMPS_xml_str__doc__},
#  789|       {"toxml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def110]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:789:17: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  789 |     {"toxml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,
#      |                 ^
#  787|       {"xml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,
#  788|       PyCOMPS_xml_str__doc__},
#  789|->     {"toxml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,
#  790|       PyCOMPS_toxml_f__doc__},
#  791|       {"toxml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def111]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:791:19: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  791 |     {"toxml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,
#      |                   ^
#  789|       {"toxml_f", (PyCFunction)PyCOMPS_toxml_f, METH_VARARGS | METH_KEYWORDS,
#  790|       PyCOMPS_toxml_f__doc__},
#  791|->     {"toxml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,
#  792|       PyCOMPS_toxml_str__doc__},
#  793|       {"fromxml_f", (PyCFunction)PyCOMPS_fromxml_f, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def112]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:793:19: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  793 |     {"fromxml_f", (PyCFunction)PyCOMPS_fromxml_f, METH_VARARGS | METH_KEYWORDS,
#      |                   ^
#  791|       {"toxml_str", (PyCFunction)PyCOMPS_toxml_str, METH_VARARGS | METH_KEYWORDS,
#  792|       PyCOMPS_toxml_str__doc__},
#  793|->     {"fromxml_f", (PyCFunction)PyCOMPS_fromxml_f, METH_VARARGS | METH_KEYWORDS,
#  794|       PyCOMPS_fromxml_f__doc__},
#  795|       {"fromxml_str", (PyCFunction)PyCOMPS_fromxml_str, METH_VARARGS | METH_KEYWORDS,

Error: COMPILER_WARNING (CWE-843): [#def113]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:795:21: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  795 |     {"fromxml_str", (PyCFunction)PyCOMPS_fromxml_str, METH_VARARGS | METH_KEYWORDS,
#      |                     ^
#  793|       {"fromxml_f", (PyCFunction)PyCOMPS_fromxml_f, METH_VARARGS | METH_KEYWORDS,
#  794|       PyCOMPS_fromxml_f__doc__},
#  795|->     {"fromxml_str", (PyCFunction)PyCOMPS_fromxml_str, METH_VARARGS | METH_KEYWORDS,
#  796|       PyCOMPS_fromxml_str__doc__},
#  797|       {"clear", (PyCFunction)PyCOMPS_clear, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def114]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:797:15: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  797 |     {"clear", (PyCFunction)PyCOMPS_clear, METH_NOARGS,
#      |               ^
#  795|       {"fromxml_str", (PyCFunction)PyCOMPS_fromxml_str, METH_VARARGS | METH_KEYWORDS,
#  796|       PyCOMPS_fromxml_str__doc__},
#  797|->     {"clear", (PyCFunction)PyCOMPS_clear, METH_NOARGS,
#  798|       "Clear Comps"},
#  799|       {"get_last_errors", (PyCFunction)PyCOMPS_get_last_errors,

Error: COMPILER_WARNING (CWE-843): [#def115]
libcomps-0.1.21/libcomps/src/python/src/pycomps.c:978:33: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  978 |     {"get_xml_default_options", (PyCFunction)Libcomps_xml_default, METH_NOARGS,
#      |                                 ^
#  976|   
#  977|   static PyMethodDef LibcompsMethods[] = {
#  978|->     {"get_xml_default_options", (PyCFunction)Libcomps_xml_default, METH_NOARGS,
#  979|        "Return xml output default options"},
#  980|       {NULL, NULL, 0, NULL}        /* Sentinel */

Error: COMPILER_WARNING (CWE-843): [#def116]
libcomps-0.1.21/libcomps/src/python/src/pycomps_categories.c:202:18: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS_Category *)’ {aka ‘struct _object * (*)(PyCOMPS_Category *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  202 |     {"validate", (PyCFunction)PyCOMPSCat_validate, METH_NOARGS,
#      |                  ^
#  200|   
#  201|   PyMethodDef PyCOMPSCat_methods[] = {
#  202|->     {"validate", (PyCFunction)PyCOMPSCat_validate, METH_NOARGS,
#  203|       "validate inner category structure"},
#  204|       {NULL}  /* Sentinel */

Error: COMPILER_WARNING (CWE-843): [#def117]
libcomps-0.1.21/libcomps/src/python/src/pycomps_dict.c:388:16: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  388 |      {"items", (PyCFunction)PyCOMPSDict_getiteritems, METH_NOARGS,
#      |                ^
#  386|        {"has_key", (PyCFunction)PyCOMPSDict_has_key, METH_O,
#  387|          PyCOMPSDict_has_key__doc__},
#  388|->      {"items", (PyCFunction)PyCOMPSDict_getiteritems, METH_NOARGS,
#  389|        "return iterator returning (key, value) tuple"},
#  390|        {"values", (PyCFunction)PyCOMPSDict_getitervalues, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def118]
libcomps-0.1.21/libcomps/src/python/src/pycomps_dict.c:390:17: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  390 |      {"values", (PyCFunction)PyCOMPSDict_getitervalues, METH_NOARGS,
#      |                 ^
#  388|        {"items", (PyCFunction)PyCOMPSDict_getiteritems, METH_NOARGS,
#  389|        "return iterator returning (key, value) tuple"},
#  390|->      {"values", (PyCFunction)PyCOMPSDict_getitervalues, METH_NOARGS,
#  391|        "return iterator returning item's value"},
#  392|        {"keys", (PyCFunction)PyCOMPSDict_getiter, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def119]
libcomps-0.1.21/libcomps/src/python/src/pycomps_dict.c:392:15: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  392 |      {"keys", (PyCFunction)PyCOMPSDict_getiter, METH_NOARGS,
#      |               ^
#  390|        {"values", (PyCFunction)PyCOMPSDict_getitervalues, METH_NOARGS,
#  391|        "return iterator returning item's value"},
#  392|->      {"keys", (PyCFunction)PyCOMPSDict_getiter, METH_NOARGS,
#  393|        "return iterator returning item's key"},
#  394|        {"clear", (PyCFunction)PyCOMPSDict_clear, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def120]
libcomps-0.1.21/libcomps/src/python/src/pycomps_dict.c:394:16: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  394 |      {"clear", (PyCFunction)PyCOMPSDict_clear, METH_NOARGS,
#      |                ^
#  392|        {"keys", (PyCFunction)PyCOMPSDict_getiter, METH_NOARGS,
#  393|        "return iterator returning item's key"},
#  394|->      {"clear", (PyCFunction)PyCOMPSDict_clear, METH_NOARGS,
#  395|        "clear the dict"},
#  396|        {"copy", (PyCFunction)PyCOMPSDict_copy, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def121]
libcomps-0.1.21/libcomps/src/python/src/pycomps_dict.c:396:15: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  396 |      {"copy", (PyCFunction)PyCOMPSDict_copy, METH_NOARGS,
#      |               ^
#  394|        {"clear", (PyCFunction)PyCOMPSDict_clear, METH_NOARGS,
#  395|        "clear the dict"},
#  396|->      {"copy", (PyCFunction)PyCOMPSDict_copy, METH_NOARGS,
#  397|        "return shallow copy of dict"},
#  398|        {"update", (PyCFunction)PyCOMPSDict_update, METH_O,

Error: COMPILER_WARNING (CWE-843): [#def122]
libcomps-0.1.21/libcomps/src/python/src/pycomps_envs.c:168:18: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS_Env *)’ {aka ‘struct _object * (*)(PyCOMPS_Env *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  168 |     {"validate", (PyCFunction)PyCOMPSEnv_validate, METH_NOARGS,
#      |                  ^
#  166|   
#  167|   PyMethodDef PyCOMPSEnv_methods[] = {
#  168|->     {"validate", (PyCFunction)PyCOMPSEnv_validate, METH_NOARGS,
#  169|       PyCOMPS_env_validate__doc__},
#  170|       {NULL}  /* Sentinel */

Error: COMPILER_WARNING (CWE-843): [#def123]
libcomps-0.1.21/libcomps/src/python/src/pycomps_gids.c:200:18: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS_GID *)’ {aka ‘struct _object * (*)(PyCOMPS_GID *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  200 |     {"validate", (PyCFunction)PyCOMPSGID_validate, METH_NOARGS,
#      |                  ^
#  198|   
#  199|   PyMethodDef PyCOMPSGID_methods[] = {
#  200|->     {"validate", (PyCFunction)PyCOMPSGID_validate, METH_NOARGS,
#  201|       "validate inner Group ID structure"},
#  202|       {NULL}  /* Sentinel */

Error: COMPILER_WARNING (CWE-843): [#def124]
libcomps-0.1.21/libcomps/src/python/src/pycomps_groups.c:213:18: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS_Group *)’ {aka ‘struct _object * (*)(PyCOMPS_Group *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  213 |     {"validate", (PyCFunction)PyCOMPSGroup_validate, METH_NOARGS,
#      |                  ^
#  211|   
#  212|   PyMethodDef PyCOMPSGroup_methods[] = {
#  213|->     {"validate", (PyCFunction)PyCOMPSGroup_validate, METH_NOARGS,
#  214|        PyCOMPS_group_validate__doc__},
#  215|       {"packages_match", (PyCFunction)PyCOMPSGroup_packages_match,

Error: COMPILER_WARNING (CWE-843): [#def125]
libcomps-0.1.21/libcomps/src/python/src/pycomps_groups.c:215:24: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *, PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *, struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  215 |     {"packages_match", (PyCFunction)PyCOMPSGroup_packages_match,
#      |                        ^
#  213|       {"validate", (PyCFunction)PyCOMPSGroup_validate, METH_NOARGS,
#  214|        PyCOMPS_group_validate__doc__},
#  215|->     {"packages_match", (PyCFunction)PyCOMPSGroup_packages_match,
#  216|        METH_VARARGS | METH_KEYWORDS,
#  217|        PyCOMPS_group_packages_match__doc__},

Error: COMPILER_WARNING (CWE-843): [#def126]
libcomps-0.1.21/libcomps/src/python/src/pycomps_groups.c:845:18: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyCOMPS_Package *)’ {aka ‘struct _object * (*)(PyCOMPS_Package *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  845 |     {"validate", (PyCFunction)PyCOMPSPackage_validate, METH_NOARGS,
#      |                  ^
#  843|   
#  844|   PyMethodDef PyCOMPSPack_methods[] = {
#  845|->     {"validate", (PyCFunction)PyCOMPSPackage_validate, METH_NOARGS,
#  846|       PyCOMPS_package_validate__doc__},
#  847|       {NULL}  /* Sentinel */

Error: COMPILER_WARNING (CWE-843): [#def127]
libcomps-0.1.21/libcomps/src/python/src/pycomps_mdict.c:408:16: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  408 |      {"items", (PyCFunction)PyCOMPSMDict_getiteritems, METH_NOARGS,
#      |                ^
#  406|        {"has_key", (PyCFunction)PyCOMPSMDict_has_key, METH_O,
#  407|        PyCOMPSMDict_has_key__doc__},
#  408|->      {"items", (PyCFunction)PyCOMPSMDict_getiteritems, METH_NOARGS,
#  409|        "return iterator returning (key, value) tuple"},
#  410|        {"values", (PyCFunction)PyCOMPSMDict_getitervalues, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def128]
libcomps-0.1.21/libcomps/src/python/src/pycomps_mdict.c:410:17: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  410 |      {"values", (PyCFunction)PyCOMPSMDict_getitervalues, METH_NOARGS,
#      |                 ^
#  408|        {"items", (PyCFunction)PyCOMPSMDict_getiteritems, METH_NOARGS,
#  409|        "return iterator returning (key, value) tuple"},
#  410|->      {"values", (PyCFunction)PyCOMPSMDict_getitervalues, METH_NOARGS,
#  411|        "return iterator returning item's value"},
#  412|        {"keys", (PyCFunction)PyCOMPSMDict_getiter, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def129]
libcomps-0.1.21/libcomps/src/python/src/pycomps_mdict.c:412:15: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  412 |      {"keys", (PyCFunction)PyCOMPSMDict_getiter, METH_NOARGS,
#      |               ^
#  410|        {"values", (PyCFunction)PyCOMPSMDict_getitervalues, METH_NOARGS,
#  411|        "return iterator returning item's value"},
#  412|->      {"keys", (PyCFunction)PyCOMPSMDict_getiter, METH_NOARGS,
#  413|        "return iterator returning item's key"},
#  414|        {"clear", (PyCFunction)PyCOMPSMDict_clear, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def130]
libcomps-0.1.21/libcomps/src/python/src/pycomps_mdict.c:414:16: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  414 |      {"clear", (PyCFunction)PyCOMPSMDict_clear, METH_NOARGS,
#      |                ^
#  412|        {"keys", (PyCFunction)PyCOMPSMDict_getiter, METH_NOARGS,
#  413|        "return iterator returning item's key"},
#  414|->      {"clear", (PyCFunction)PyCOMPSMDict_clear, METH_NOARGS,
#  415|        "clear the dict"},
#  416|        {"copy", (PyCFunction)PyCOMPSMDict_copy, METH_NOARGS,

Error: COMPILER_WARNING (CWE-843): [#def131]
libcomps-0.1.21/libcomps/src/python/src/pycomps_mdict.c:416:15: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  416 |      {"copy", (PyCFunction)PyCOMPSMDict_copy, METH_NOARGS,
#      |               ^
#  414|        {"clear", (PyCFunction)PyCOMPSMDict_clear, METH_NOARGS,
#  415|        "clear the dict"},
#  416|->      {"copy", (PyCFunction)PyCOMPSMDict_copy, METH_NOARGS,
#  417|        "return shallow copy of dict"},
#  418|        {"update", (PyCFunction)PyCOMPSMDict_update, METH_O,

Error: CLANG_WARNING: [#def132]
libcomps-0.1.21/libcomps/src/python/src/pycomps_sequence.c:351:57: warning[core.NullDereference]: Access to field 'comps_obj' results in a dereference of a null pointer (loaded from variable 'it2')
#  349|                       }
#  350|                       COMPS_OBJECT_DESTROY(it->comps_obj);
#  351|->                     it->comps_obj = comps_object_incref(it2->comps_obj);
#  352|                       clen += 1;
#  353|                       it2 = it2->next;

Error: CLANG_WARNING: [#def133]
libcomps-0.1.21/libcomps/src/python/src/pycomps_sequence.c:356:40: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'it')
#  354|                       for (i=0 ; i<istep && it != NULL; it=it->next,  i++);
#  355|                       if (!it) it = _seq_->list->first;
#  356|->                     for (; i<istep; it=it->next, i++);
#  357|                   }
#  358|               } else {

Error: CLANG_WARNING: [#def134]
libcomps-0.1.21/libcomps/src/python/src/pycomps_sequence.c:397:36: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'it')
#  395|                   for (i=0 ; i<istep && it != NULL; it=it->next,  i++);
#  396|                   if (!it) it = _seq_->list->first;
#  397|->                 for (; i<istep; it=it->next, i++);
#  398|               }
#  399|               it2 = NULL;

Error: COMPILER_WARNING (CWE-843): [#def135]
libcomps-0.1.21/libcomps/src/python/src/pycomps_sequence.c:646:16: warning[-Wcast-function-type]: cast between incompatible function types from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’} to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
#  646 |      {"clear", (PyCFunction)PyCOMPSSeq_clear, METH_NOARGS,
#      |                ^
#  644|        {"remove", (PyCFunction)PyCOMPSSeq_remove, METH_O,
#  645|        PyCOMPSSeq_remove__doc__},
#  646|->      {"clear", (PyCFunction)PyCOMPSSeq_clear, METH_NOARGS,
#  647|        "Clear the list"},
#  648|        {"insert", (PyCFunction)PyCOMPSSeq_insert, METH_VARARGS,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def136]
libcomps-0.1.21/libcomps/src/python/src/pycomps_utils.c:126:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  124|           }
#  125|           *ret = malloc(sizeof(char) * (strlen(tmp)+1));
#  126|->         memcpy(*ret, tmp, sizeof(char) * (strlen(tmp)+1));
#  127|           Py_XDECREF(o);
#  128|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def137]
libcomps-0.1.21/libcomps/src/python/src/pycomps_utils.c: scope_hint: In function ‘__pycomps_PyUnicode_AsString’
libcomps-0.1.21/libcomps/src/python/src/pycomps_utils.c:126:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘tmp’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  124|           }
#  125|           *ret = malloc(sizeof(char) * (strlen(tmp)+1));
#  126|->         memcpy(*ret, tmp, sizeof(char) * (strlen(tmp)+1));
#  127|           Py_XDECREF(o);
#  128|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def138]
libcomps-0.1.21/libcomps/src/python/src/pycomps_utils.c: scope_hint: In function ‘__pycomps_strcloner’
libcomps-0.1.21/libcomps/src/python/src/pycomps_utils.c:171:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  169|       void *ret;
#  170|       ret = malloc(sizeof(char)*(strlen(str)+1));
#  171|->     memcpy(ret, str, sizeof(char)*(strlen(str)+1));
#  172|       return ret;
#  173|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def139]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘make_test_struct’
libcomps-0.1.21/libcomps/tests/check_brtree.c:36:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#   34|       struct _teststruct *ret;
#   35|       ret = malloc(sizeof(struct _teststruct));
#   36|->     ret->testdata = malloc(sizeof(char)*(strlen(testdata)+1));
#   37|       memcpy(ret->testdata, testdata, sizeof(char)*(strlen(testdata)+1));
#   38|       return ret;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def140]
libcomps-0.1.21/libcomps/tests/check_brtree.c:37:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(testdata) + 1)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#   35|       ret = malloc(sizeof(struct _teststruct));
#   36|       ret->testdata = malloc(sizeof(char)*(strlen(testdata)+1));
#   37|->     memcpy(ret->testdata, testdata, sizeof(char)*(strlen(testdata)+1));
#   38|       return ret;
#   39|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def141]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘key_clone’
libcomps-0.1.21/libcomps/tests/check_brtree.c:77:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#   75|       ret = malloc(sizeof(struct _key));
#   76|       ret->key = malloc(sizeof(char)*len);
#   77|->     ret->key = memcpy(ret->key, ((struct _key*)key)->key, sizeof(char)*len);
#   78|       ret->keylen = len;
#   79|       /*printf("clonned key\n");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def142]
libcomps-0.1.21/libcomps/tests/check_brtree.c:77:16: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)len)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#   75|       ret = malloc(sizeof(struct _key));
#   76|       ret->key = malloc(sizeof(char)*len);
#   77|->     ret->key = memcpy(ret->key, ((struct _key*)key)->key, sizeof(char)*len);
#   78|       ret->keylen = len;
#   79|       /*printf("clonned key\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def143]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘make_key’
libcomps-0.1.21/libcomps/tests/check_brtree.c:89:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#   87|       unsigned char i;
#   88|       ret = malloc(sizeof(struct _key));
#   89|->     ret->key = malloc(sizeof(char)*sizeof(x));
#   90|       for (i = 0; i<sizeof(x); i++) {
#   91|           ret->key[i] = ((char*)&x)[sizeof(x)-i-1];

Error: GCC_ANALYZER_WARNING (CWE-476): [#def144]
libcomps-0.1.21/libcomps/tests/check_brtree.c:91:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(8)’
#   89|       ret->key = malloc(sizeof(char)*sizeof(x));
#   90|       for (i = 0; i<sizeof(x); i++) {
#   91|->         ret->key[i] = ((char*)&x)[sizeof(x)-i-1];
#   92|       }
#   93|       /*printf("make_key\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def145]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘subkey’
libcomps-0.1.21/libcomps/tests/check_brtree.c:135:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#  133|       ret = malloc(sizeof(struct _key));
#  134|       //ret->key = ((struct _key*)key)->key;
#  135|->     ret->key = malloc(sizeof(char)*len);
#  136|       //memset(((char*)&ret->key), 0, offset);
#  137|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def146]
libcomps-0.1.21/libcomps/tests/check_brtree.c:138:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc((long unsigned int)len)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  136|       //memset(((char*)&ret->key), 0, offset);
#  137|   
#  138|->     memcpy(ret->key, ((struct _key*)key)->key+offset, len-offset);
#  139|       //printf("subkey offset:%d len:%d\n", offset, len);
#  140|       ret->keylen = len-offset;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘key_concat’
libcomps-0.1.21/libcomps/tests/check_brtree.c:156:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#  154|       unsigned int i, len;
#  155|       ret = malloc(sizeof(struct _key));
#  156|->     ret->key = malloc(sizeof(char)*(((struct _key*)key1)->keylen +\
#  157|                                       ((struct _key*)key2)->keylen));
#  158|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def148]
libcomps-0.1.21/libcomps/tests/check_brtree.c:163:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)(*(struct _key *)key1.keylen + *(struct _key *)key2.keylen))’
#  161|   
#  162|       for (i = 0; i < ((struct _key*)key1)->keylen; i++)
#  163|->         ret->key[i] = ((struct _key*)key1)->key[i];
#  164|       ret->keylen = i; 
#  165|       len = i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
libcomps-0.1.21/libcomps/tests/check_brtree.c:168:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)(*(struct _key *)key1.keylen + *(struct _key *)key2.keylen))’
#  166|       //printf("len: %d\n", len);
#  167|       for (i = 0; i < ((struct _key*)key2)->keylen; i++)
#  168|->         ret->key[i+len] = ((struct _key*)key2)->key[i];
#  169|       //printf("len2: %d\n", ((struct _key*)key2)->keylen);
#  170|       ret->keylen += i;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def150]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘int_cloner’
libcomps-0.1.21/libcomps/tests/check_brtree.c:191:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
#  189|   void* int_cloner(void * int_v) {
#  190|       void * ret = malloc(sizeof(int));
#  191|->     memcpy(ret, int_v, sizeof(int));
#  192|       return ret;
#  193|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def151]
libcomps-0.1.21/libcomps/tests/check_brtree.c: scope_hint: In function ‘str_cloner’
libcomps-0.1.21/libcomps/tests/check_brtree.c:197:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#  195|   void* str_cloner(void *str) {
#  196|       void *ret = malloc(sizeof(char)* (strlen((char*)str)+1));
#  197|->     memcpy(ret, str, (strlen((char*)str)+1));
#  198|       return ret;
#  199|   }

Error: CLANG_WARNING: [#def152]
libcomps-0.1.21/libcomps/tests/check_brtree.c:330:5: warning[deadcode.DeadStores]: Value stored to 'test' is never read
#  328|       *test = NULL;
#  329|       key = make_key(&test1);
#  330|->     test = comps_brtree_get(tree, key);
#  331|       key_destroy(key);
#  332|       comps_brtree_destroy(tree);

Error: COMPILER_WARNING (CWE-685): [#def153]
libcomps-0.1.21/libcomps/tests/check_comps.c:20: included_from: Included from here.
libcomps-0.1.21/libcomps/tests/check_comps.c: scope_hint: In function ‘test_comps_doc_basic_fn’
libcomps-0.1.21/libcomps/tests/check_comps.c:90:32: warning[-Wformat-extra-args]: too many arguments for format
#   90 |     fail_if(tmplist->len == 0, "No groups found");
#      |                                ^~~~~~~~~~~~~~~~~
#   88|       }
#   89|       tmplist = comps_doc_groups(doc);
#   90|->     fail_if(tmplist->len == 0, "No groups found");
#   91|       g = (COMPS_DocGroup*)tmplist->first->comps_obj;
#   92|       COMPS_OBJECT_DESTROY(tmplist);

Error: CLANG_WARNING: [#def154]
libcomps-0.1.21/libcomps/tests/check_comps.c:91:5: warning[deadcode.DeadStores]: Value stored to 'g' is never read
#   89|       tmplist = comps_doc_groups(doc);
#   90|       fail_if(tmplist->len == 0, "No groups found");
#   91|->     g = (COMPS_DocGroup*)tmplist->first->comps_obj;
#   92|       COMPS_OBJECT_DESTROY(tmplist);
#   93|   

Error: COMPILER_WARNING (CWE-685): [#def155]
libcomps-0.1.21/libcomps/tests/check_comps.c:95:32: warning[-Wformat-extra-args]: too many arguments for format
#   95 |     fail_if(tmplist->len == 0, "Group with id 'g1' should be in groups, but"
#      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   93|   
#   94|       tmplist = comps_doc_get_groups(doc, "g1", NULL, NULL, NULL, 0);
#   95|->     fail_if(tmplist->len == 0, "Group with id 'g1' should be in groups, but"
#   96|                                  "cant get it");
#   97|       g = (COMPS_DocGroup*)tmplist->first->comps_obj;

Error: COMPILER_WARNING (CWE-685): [#def156]
libcomps-0.1.21/libcomps/tests/check_comps.c:101:32: warning[-Wformat-extra-args]: too many arguments for format
#   99|   
#  100|       tmplist = comps_docgroup_get_packages(g, NULL, COMPS_PACKAGE_OPTIONAL);
#  101|->     fail_if(tmplist->len != 4, "Group with id 'g1' should have 4 optional "
#  102|                                  "packages. But have %d.", tmplist->len);
#  103|       COMPS_OBJECT_DESTROY(tmplist);

Error: COMPILER_WARNING: [#def157]
libcomps-0.1.21/libcomps/tests/check_comps.c:101:32: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  101 |     fail_if(tmplist->len != 4, "Group with id 'g1' should have 4 optional "
#      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  102 |                                "packages. But have %d.", tmplist->len);
#      |                                                          ~~~~~~~~~~~~
#      |                                                                 |
#      |                                                                 size_t {aka long unsigned int}
#   99|   
#  100|       tmplist = comps_docgroup_get_packages(g, NULL, COMPS_PACKAGE_OPTIONAL);
#  101|->     fail_if(tmplist->len != 4, "Group with id 'g1' should have 4 optional "
#  102|                                  "packages. But have %d.", tmplist->len);
#  103|       COMPS_OBJECT_DESTROY(tmplist);

Error: COMPILER_WARNING (CWE-685): [#def158]
libcomps-0.1.21/libcomps/tests/check_comps.c:105:32: warning[-Wformat-extra-args]: too many arguments for format
#  103|       COMPS_OBJECT_DESTROY(tmplist);
#  104|       tmplist = comps_docgroup_get_packages(g, NULL, COMPS_PACKAGE_MANDATORY);
#  105|->     fail_if(tmplist->len != 4, "Group with id 'g1' should have 4 optional "
#  106|                                  "packages. But have %d.", tmplist->len);
#  107|       COMPS_OBJECT_DESTROY(tmplist);

Error: COMPILER_WARNING: [#def159]
libcomps-0.1.21/libcomps/tests/check_comps.c:105:32: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  105 |     fail_if(tmplist->len != 4, "Group with id 'g1' should have 4 optional "
#      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  106 |                                "packages. But have %d.", tmplist->len);
#      |                                                          ~~~~~~~~~~~~
#      |                                                                 |
#      |                                                                 size_t {aka long unsigned int}
#  103|       COMPS_OBJECT_DESTROY(tmplist);
#  104|       tmplist = comps_docgroup_get_packages(g, NULL, COMPS_PACKAGE_MANDATORY);
#  105|->     fail_if(tmplist->len != 4, "Group with id 'g1' should have 4 optional "
#  106|                                  "packages. But have %d.", tmplist->len);
#  107|       COMPS_OBJECT_DESTROY(tmplist);

Error: COMPILER_WARNING (CWE-685): [#def160]
libcomps-0.1.21/libcomps/tests/check_comps.c:279:37: warning[-Wformat-extra-args]: too many arguments for format
#  277|       g2 = (COMPS_DocGroup*)list->first->next->comps_obj;
#  278|       g = comps_docgroup_union(g1, g2);
#  279|->     fail_if(g->packages->len != 14, "Union of (g1 v g2) should have 14 packages"
#  280|               " have %d", g->packages->len);
#  281|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING: [#def161]
libcomps-0.1.21/libcomps/tests/check_comps.c: scope_hint: In function ‘test_comps_doc_setfeats_fn’
libcomps-0.1.21/libcomps/tests/check_comps.c:279:37: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  279 |     fail_if(g->packages->len != 14, "Union of (g1 v g2) should have 14 packages"
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  280 |             " have %d", g->packages->len);
#      |                         ~~~~~~~~~~~~~~~~
#      |                                    |
#      |                                    size_t {aka long unsigned int}
#  277|       g2 = (COMPS_DocGroup*)list->first->next->comps_obj;
#  278|       g = comps_docgroup_union(g1, g2);
#  279|->     fail_if(g->packages->len != 14, "Union of (g1 v g2) should have 14 packages"
#  280|               " have %d", g->packages->len);
#  281|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING (CWE-685): [#def162]
libcomps-0.1.21/libcomps/tests/check_comps.c:283:36: warning[-Wformat-extra-args]: too many arguments for format
#  281|       COMPS_OBJECT_DESTROY(g);
#  282|       g = comps_docgroup_intersect(g1, g2);
#  283|->     fail_if(g->packages->len != 2, "Intersect of (g1 ^ g2) should have 2"
#  284|               "packages, have %d", g->packages->len);
#  285|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING: [#def163]
libcomps-0.1.21/libcomps/tests/check_comps.c:283:36: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  283 |     fail_if(g->packages->len != 2, "Intersect of (g1 ^ g2) should have 2"
#      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  284 |             "packages, have %d", g->packages->len);
#      |                                  ~~~~~~~~~~~~~~~~
#      |                                             |
#      |                                             size_t {aka long unsigned int}
#  281|       COMPS_OBJECT_DESTROY(g);
#  282|       g = comps_docgroup_intersect(g1, g2);
#  283|->     fail_if(g->packages->len != 2, "Intersect of (g1 ^ g2) should have 2"
#  284|               "packages, have %d", g->packages->len);
#  285|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING (CWE-685): [#def164]
libcomps-0.1.21/libcomps/tests/check_comps.c:289:37: warning[-Wformat-extra-args]: too many arguments for format
#  287|       g2 = (COMPS_DocGroup*)list->first->next->next->comps_obj;
#  288|       g = comps_docgroup_union(g1, g2);
#  289|->     fail_if(g->packages->len != 16, "Union of (g2 v g3) should have 16 packages"
#  290|               " have %d", g->packages->len);
#  291|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING: [#def165]
libcomps-0.1.21/libcomps/tests/check_comps.c:289:37: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  289 |     fail_if(g->packages->len != 16, "Union of (g2 v g3) should have 16 packages"
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  290 |             " have %d", g->packages->len);
#      |                         ~~~~~~~~~~~~~~~~
#      |                                    |
#      |                                    size_t {aka long unsigned int}
#  287|       g2 = (COMPS_DocGroup*)list->first->next->next->comps_obj;
#  288|       g = comps_docgroup_union(g1, g2);
#  289|->     fail_if(g->packages->len != 16, "Union of (g2 v g3) should have 16 packages"
#  290|               " have %d", g->packages->len);
#  291|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING (CWE-685): [#def166]
libcomps-0.1.21/libcomps/tests/check_comps.c:293:36: warning[-Wformat-extra-args]: too many arguments for format
#  291|       COMPS_OBJECT_DESTROY(g);
#  292|       g = comps_docgroup_intersect(g1, g2);
#  293|->     fail_if(g->packages->len != 0, "Intersect of (g2 ^ g3) should have 0"
#  294|               "packages, have %d", g->packages->len);
#  295|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING: [#def167]
libcomps-0.1.21/libcomps/tests/check_comps.c:293:36: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  293 |     fail_if(g->packages->len != 0, "Intersect of (g2 ^ g3) should have 0"
#      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  294 |             "packages, have %d", g->packages->len);
#      |                                  ~~~~~~~~~~~~~~~~
#      |                                             |
#      |                                             size_t {aka long unsigned int}
#  291|       COMPS_OBJECT_DESTROY(g);
#  292|       g = comps_docgroup_intersect(g1, g2);
#  293|->     fail_if(g->packages->len != 0, "Intersect of (g2 ^ g3) should have 0"
#  294|               "packages, have %d", g->packages->len);
#  295|       COMPS_OBJECT_DESTROY(g);

Error: COMPILER_WARNING (CWE-685): [#def168]
libcomps-0.1.21/libcomps/tests/check_comps.c:303:37: warning[-Wformat-extra-args]: too many arguments for format
#  301|       c = comps_doccategory_union(c1, c2);
#  302|       //print_category(c);
#  303|->     fail_if(c->group_ids->len != 4, "Union of (c1 v c2) should have 4 "
#  304|               "group ids, have %d", c->group_ids->len);
#  305|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING: [#def169]
libcomps-0.1.21/libcomps/tests/check_comps.c:303:37: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  303 |     fail_if(c->group_ids->len != 4, "Union of (c1 v c2) should have 4 "
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  304 |             "group ids, have %d", c->group_ids->len);
#      |                                   ~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  301|       c = comps_doccategory_union(c1, c2);
#  302|       //print_category(c);
#  303|->     fail_if(c->group_ids->len != 4, "Union of (c1 v c2) should have 4 "
#  304|               "group ids, have %d", c->group_ids->len);
#  305|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING (CWE-685): [#def170]
libcomps-0.1.21/libcomps/tests/check_comps.c:308:37: warning[-Wformat-extra-args]: too many arguments for format
#  306|   
#  307|       c = comps_doccategory_intersect(c1, c2);
#  308|->     fail_if(c->group_ids->len != 2, "Intersect of (c1 ^ c2) should have 2"
#  309|               "group ids, have %d", c->group_ids->len);
#  310|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING: [#def171]
libcomps-0.1.21/libcomps/tests/check_comps.c:308:37: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  308 |     fail_if(c->group_ids->len != 2, "Intersect of (c1 ^ c2) should have 2"
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  309 |             "group ids, have %d", c->group_ids->len);
#      |                                   ~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  306|   
#  307|       c = comps_doccategory_intersect(c1, c2);
#  308|->     fail_if(c->group_ids->len != 2, "Intersect of (c1 ^ c2) should have 2"
#  309|               "group ids, have %d", c->group_ids->len);
#  310|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING (CWE-685): [#def172]
libcomps-0.1.21/libcomps/tests/check_comps.c:315:37: warning[-Wformat-extra-args]: too many arguments for format
#  313|       c2 = (COMPS_DocCategory*)list->first->next->next->comps_obj;
#  314|       c = comps_doccategory_union(c1, c2);
#  315|->     fail_if(c->group_ids->len != 4, "Union of (c2 v c3) should have 4 "
#  316|               "group ids, have %d", c->group_ids->len);
#  317|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING: [#def173]
libcomps-0.1.21/libcomps/tests/check_comps.c:315:37: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  315 |     fail_if(c->group_ids->len != 4, "Union of (c2 v c3) should have 4 "
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  316 |             "group ids, have %d", c->group_ids->len);
#      |                                   ~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  313|       c2 = (COMPS_DocCategory*)list->first->next->next->comps_obj;
#  314|       c = comps_doccategory_union(c1, c2);
#  315|->     fail_if(c->group_ids->len != 4, "Union of (c2 v c3) should have 4 "
#  316|               "group ids, have %d", c->group_ids->len);
#  317|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING (CWE-685): [#def174]
libcomps-0.1.21/libcomps/tests/check_comps.c:319:37: warning[-Wformat-extra-args]: too many arguments for format
#  317|       COMPS_OBJECT_DESTROY(c);
#  318|       c = comps_doccategory_intersect(c1, c2);
#  319|->     fail_if(c->group_ids->len != 2, "Intersect of (c2 ^ c3) should have 2"
#  320|               "group ids, have %d", c->group_ids->len);
#  321|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING: [#def175]
libcomps-0.1.21/libcomps/tests/check_comps.c:319:37: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  319 |     fail_if(c->group_ids->len != 2, "Intersect of (c2 ^ c3) should have 2"
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  320 |             "group ids, have %d", c->group_ids->len);
#      |                                   ~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  317|       COMPS_OBJECT_DESTROY(c);
#  318|       c = comps_doccategory_intersect(c1, c2);
#  319|->     fail_if(c->group_ids->len != 2, "Intersect of (c2 ^ c3) should have 2"
#  320|               "group ids, have %d", c->group_ids->len);
#  321|       COMPS_OBJECT_DESTROY(c);

Error: COMPILER_WARNING (CWE-685): [#def176]
libcomps-0.1.21/libcomps/tests/check_comps.c:328:38: warning[-Wformat-extra-args]: too many arguments for format
#  326|       e2 = (COMPS_DocEnv*)list->first->next->comps_obj;
#  327|       e = comps_docenv_union(e1, e2);
#  328|->     fail_if(e->group_list->len != 4, "Union of (e1 v e2) should have 4 "
#  329|               "groud ids have %d", e->group_list->len);
#  330|       fail_if(e->option_list->len != 7, "Union of (e1 v e2) should have 7 "

Error: COMPILER_WARNING: [#def177]
libcomps-0.1.21/libcomps/tests/check_comps.c:328:38: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  328 |     fail_if(e->group_list->len != 4, "Union of (e1 v e2) should have 4 "
#      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  329 |             "groud ids have %d", e->group_list->len);
#      |                                  ~~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  326|       e2 = (COMPS_DocEnv*)list->first->next->comps_obj;
#  327|       e = comps_docenv_union(e1, e2);
#  328|->     fail_if(e->group_list->len != 4, "Union of (e1 v e2) should have 4 "
#  329|               "groud ids have %d", e->group_list->len);
#  330|       fail_if(e->option_list->len != 7, "Union of (e1 v e2) should have 7 "

Error: COMPILER_WARNING (CWE-685): [#def178]
libcomps-0.1.21/libcomps/tests/check_comps.c:330:39: warning[-Wformat-extra-args]: too many arguments for format
#  328|       fail_if(e->group_list->len != 4, "Union of (e1 v e2) should have 4 "
#  329|               "groud ids have %d", e->group_list->len);
#  330|->     fail_if(e->option_list->len != 7, "Union of (e1 v e2) should have 7 "
#  331|               "option ids have %d", e->option_list->len);
#  332|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING: [#def179]
libcomps-0.1.21/libcomps/tests/check_comps.c:330:39: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  330 |     fail_if(e->option_list->len != 7, "Union of (e1 v e2) should have 7 "
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  331 |             "option ids have %d", e->option_list->len);
#      |                                   ~~~~~~~~~~~~~~~~~~~
#      |                                                 |
#      |                                                 size_t {aka long unsigned int}
#  328|       fail_if(e->group_list->len != 4, "Union of (e1 v e2) should have 4 "
#  329|               "groud ids have %d", e->group_list->len);
#  330|->     fail_if(e->option_list->len != 7, "Union of (e1 v e2) should have 7 "
#  331|               "option ids have %d", e->option_list->len);
#  332|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING (CWE-685): [#def180]
libcomps-0.1.21/libcomps/tests/check_comps.c:334:38: warning[-Wformat-extra-args]: too many arguments for format
#  332|       COMPS_OBJECT_DESTROY(e);
#  333|       e = comps_docenv_intersect(e1, e2);
#  334|->     fail_if(e->group_list->len != 2, "Intersect of (e1 ^ e2) should have 2"
#  335|               "group ids have %d", e->group_list->len);
#  336|       fail_if(e->option_list->len != 1, "Union of (e1 v e2) should have 1 "

Error: COMPILER_WARNING: [#def181]
libcomps-0.1.21/libcomps/tests/check_comps.c:334:38: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  334 |     fail_if(e->group_list->len != 2, "Intersect of (e1 ^ e2) should have 2"
#      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  335 |             "group ids have %d", e->group_list->len);
#      |                                  ~~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  332|       COMPS_OBJECT_DESTROY(e);
#  333|       e = comps_docenv_intersect(e1, e2);
#  334|->     fail_if(e->group_list->len != 2, "Intersect of (e1 ^ e2) should have 2"
#  335|               "group ids have %d", e->group_list->len);
#  336|       fail_if(e->option_list->len != 1, "Union of (e1 v e2) should have 1 "

Error: COMPILER_WARNING (CWE-685): [#def182]
libcomps-0.1.21/libcomps/tests/check_comps.c:336:39: warning[-Wformat-extra-args]: too many arguments for format
#  334|       fail_if(e->group_list->len != 2, "Intersect of (e1 ^ e2) should have 2"
#  335|               "group ids have %d", e->group_list->len);
#  336|->     fail_if(e->option_list->len != 1, "Union of (e1 v e2) should have 1 "
#  337|               "option ids have %d", e->option_list->len);
#  338|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING: [#def183]
libcomps-0.1.21/libcomps/tests/check_comps.c:336:39: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  336 |     fail_if(e->option_list->len != 1, "Union of (e1 v e2) should have 1 "
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  337 |             "option ids have %d", e->option_list->len);
#      |                                   ~~~~~~~~~~~~~~~~~~~
#      |                                                 |
#      |                                                 size_t {aka long unsigned int}
#  334|       fail_if(e->group_list->len != 2, "Intersect of (e1 ^ e2) should have 2"
#  335|               "group ids have %d", e->group_list->len);
#  336|->     fail_if(e->option_list->len != 1, "Union of (e1 v e2) should have 1 "
#  337|               "option ids have %d", e->option_list->len);
#  338|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING (CWE-685): [#def184]
libcomps-0.1.21/libcomps/tests/check_comps.c:343:38: warning[-Wformat-extra-args]: too many arguments for format
#  341|       e2 = (COMPS_DocEnv*)list->first->next->next->comps_obj;
#  342|       e = comps_docenv_union(e1, e2);
#  343|->     fail_if(e->group_list->len != 4, "Union of (e2 v e3) should have 4 "
#  344|               "groud ids have %d", e->group_list->len);
#  345|       fail_if(e->option_list->len != 6, "Union of (e2 v e3) should have 7 "

Error: COMPILER_WARNING: [#def185]
libcomps-0.1.21/libcomps/tests/check_comps.c:343:38: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  343 |     fail_if(e->group_list->len != 4, "Union of (e2 v e3) should have 4 "
#      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  344 |             "groud ids have %d", e->group_list->len);
#      |                                  ~~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  341|       e2 = (COMPS_DocEnv*)list->first->next->next->comps_obj;
#  342|       e = comps_docenv_union(e1, e2);
#  343|->     fail_if(e->group_list->len != 4, "Union of (e2 v e3) should have 4 "
#  344|               "groud ids have %d", e->group_list->len);
#  345|       fail_if(e->option_list->len != 6, "Union of (e2 v e3) should have 7 "

Error: COMPILER_WARNING (CWE-685): [#def186]
libcomps-0.1.21/libcomps/tests/check_comps.c:345:39: warning[-Wformat-extra-args]: too many arguments for format
#  343|       fail_if(e->group_list->len != 4, "Union of (e2 v e3) should have 4 "
#  344|               "groud ids have %d", e->group_list->len);
#  345|->     fail_if(e->option_list->len != 6, "Union of (e2 v e3) should have 7 "
#  346|               "option ids have %d", e->option_list->len);
#  347|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING: [#def187]
libcomps-0.1.21/libcomps/tests/check_comps.c:345:39: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  345 |     fail_if(e->option_list->len != 6, "Union of (e2 v e3) should have 7 "
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  346 |             "option ids have %d", e->option_list->len);
#      |                                   ~~~~~~~~~~~~~~~~~~~
#      |                                                 |
#      |                                                 size_t {aka long unsigned int}
#  343|       fail_if(e->group_list->len != 4, "Union of (e2 v e3) should have 4 "
#  344|               "groud ids have %d", e->group_list->len);
#  345|->     fail_if(e->option_list->len != 6, "Union of (e2 v e3) should have 7 "
#  346|               "option ids have %d", e->option_list->len);
#  347|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING (CWE-685): [#def188]
libcomps-0.1.21/libcomps/tests/check_comps.c:349:38: warning[-Wformat-extra-args]: too many arguments for format
#  347|       COMPS_OBJECT_DESTROY(e);
#  348|       e = comps_docenv_intersect(e1, e2);
#  349|->     fail_if(e->group_list->len != 2, "Intersect of (e2 ^ e3) should have 2 "
#  350|               "groupids  have %d", e->group_list->len);
#  351|       fail_if(e->option_list->len != 2, "Intersect of (e2 v e3) should have 2 "

Error: COMPILER_WARNING: [#def189]
libcomps-0.1.21/libcomps/tests/check_comps.c:349:38: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  349 |     fail_if(e->group_list->len != 2, "Intersect of (e2 ^ e3) should have 2 "
#      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  350 |             "groupids  have %d", e->group_list->len);
#      |                                  ~~~~~~~~~~~~~~~~~~
#      |                                               |
#      |                                               size_t {aka long unsigned int}
#  347|       COMPS_OBJECT_DESTROY(e);
#  348|       e = comps_docenv_intersect(e1, e2);
#  349|->     fail_if(e->group_list->len != 2, "Intersect of (e2 ^ e3) should have 2 "
#  350|               "groupids  have %d", e->group_list->len);
#  351|       fail_if(e->option_list->len != 2, "Intersect of (e2 v e3) should have 2 "

Error: COMPILER_WARNING (CWE-685): [#def190]
libcomps-0.1.21/libcomps/tests/check_comps.c:351:39: warning[-Wformat-extra-args]: too many arguments for format
#  349|       fail_if(e->group_list->len != 2, "Intersect of (e2 ^ e3) should have 2 "
#  350|               "groupids  have %d", e->group_list->len);
#  351|->     fail_if(e->option_list->len != 2, "Intersect of (e2 v e3) should have 2 "
#  352|               "option ids have %d", e->option_list->len);
#  353|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING: [#def191]
libcomps-0.1.21/libcomps/tests/check_comps.c:351:39: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  351 |     fail_if(e->option_list->len != 2, "Intersect of (e2 v e3) should have 2 "
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  352 |             "option ids have %d", e->option_list->len);
#      |                                   ~~~~~~~~~~~~~~~~~~~
#      |                                                 |
#      |                                                 size_t {aka long unsigned int}
#  349|       fail_if(e->group_list->len != 2, "Intersect of (e2 ^ e3) should have 2 "
#  350|               "groupids  have %d", e->group_list->len);
#  351|->     fail_if(e->option_list->len != 2, "Intersect of (e2 v e3) should have 2 "
#  352|               "option ids have %d", e->option_list->len);
#  353|       COMPS_OBJECT_DESTROY(e);

Error: COMPILER_WARNING (CWE-685): [#def192]
libcomps-0.1.21/libcomps/tests/check_comps.c:358:29: warning[-Wformat-extra-args]: too many arguments for format
#  356|       tmpdoc = comps_doc_union(doc, doc2);
#  357|       list = comps_doc_groups(tmpdoc);
#  358|->     fail_if(list->len != 6, "Union of (doc ^ doc2) should have 6 "
#  359|               "groups  have %d", list->len);
#  360|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def193]
libcomps-0.1.21/libcomps/tests/check_comps.c:358:29: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  358 |     fail_if(list->len != 6, "Union of (doc ^ doc2) should have 6 "
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  359 |             "groups  have %d", list->len);
#      |                                ~~~~~~~~~
#      |                                    |
#      |                                    size_t {aka long unsigned int}
#  356|       tmpdoc = comps_doc_union(doc, doc2);
#  357|       list = comps_doc_groups(tmpdoc);
#  358|->     fail_if(list->len != 6, "Union of (doc ^ doc2) should have 6 "
#  359|               "groups  have %d", list->len);
#  360|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING (CWE-685): [#def194]
libcomps-0.1.21/libcomps/tests/check_comps.c:362:29: warning[-Wformat-extra-args]: too many arguments for format
#  360|       COMPS_OBJECT_DESTROY(list);
#  361|       list = comps_doc_categories(tmpdoc);
#  362|->     fail_if(list->len != 4, "Union of (doc ^ doc2) "
#  363|               "should have 4 categories  have %d", list->len);
#  364|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def195]
libcomps-0.1.21/libcomps/tests/check_comps.c:362:29: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  362 |     fail_if(list->len != 4, "Union of (doc ^ doc2) "
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~
#  363 |             "should have 4 categories  have %d", list->len);
#      |                                                  ~~~~~~~~~
#      |                                                      |
#      |                                                      size_t {aka long unsigned int}
#  360|       COMPS_OBJECT_DESTROY(list);
#  361|       list = comps_doc_categories(tmpdoc);
#  362|->     fail_if(list->len != 4, "Union of (doc ^ doc2) "
#  363|               "should have 4 categories  have %d", list->len);
#  364|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING (CWE-685): [#def196]
libcomps-0.1.21/libcomps/tests/check_comps.c:366:29: warning[-Wformat-extra-args]: too many arguments for format
#  364|       COMPS_OBJECT_DESTROY(list);
#  365|       list = comps_doc_environments(tmpdoc);
#  366|->     fail_if(list->len != 4, "Union of (doc ^ doc2) "
#  367|               "should have 4 environments  have %d", list->len);
#  368|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def197]
libcomps-0.1.21/libcomps/tests/check_comps.c:366:29: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  366 |     fail_if(list->len != 4, "Union of (doc ^ doc2) "
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~
#  367 |             "should have 4 environments  have %d", list->len);
#      |                                                    ~~~~~~~~~
#      |                                                        |
#      |                                                        size_t {aka long unsigned int}
#  364|       COMPS_OBJECT_DESTROY(list);
#  365|       list = comps_doc_environments(tmpdoc);
#  366|->     fail_if(list->len != 4, "Union of (doc ^ doc2) "
#  367|               "should have 4 environments  have %d", list->len);
#  368|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING (CWE-685): [#def198]
libcomps-0.1.21/libcomps/tests/check_comps.c:372:29: warning[-Wformat-extra-args]: too many arguments for format
#  370|       tmpdoc = comps_doc_intersect(doc, doc2);
#  371|       list = comps_doc_groups(tmpdoc);
#  372|->     fail_if(list->len != 2, "Intersect of (doc ^ doc2) "
#  373|               "should have 2 groups  have %d", list->len);
#  374|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def199]
libcomps-0.1.21/libcomps/tests/check_comps.c:372:29: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  372 |     fail_if(list->len != 2, "Intersect of (doc ^ doc2) "
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  373 |             "should have 2 groups  have %d", list->len);
#      |                                              ~~~~~~~~~
#      |                                                  |
#      |                                                  size_t {aka long unsigned int}
#  370|       tmpdoc = comps_doc_intersect(doc, doc2);
#  371|       list = comps_doc_groups(tmpdoc);
#  372|->     fail_if(list->len != 2, "Intersect of (doc ^ doc2) "
#  373|               "should have 2 groups  have %d", list->len);
#  374|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING (CWE-685): [#def200]
libcomps-0.1.21/libcomps/tests/check_comps.c:376:29: warning[-Wformat-extra-args]: too many arguments for format
#  374|       COMPS_OBJECT_DESTROY(list);
#  375|       list = comps_doc_categories(tmpdoc);
#  376|->     fail_if(list->len != 2, "Intersect of (doc ^ doc2)"
#  377|               " should have 2 categories  have %d", list->len);
#  378|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def201]
libcomps-0.1.21/libcomps/tests/check_comps.c:376:29: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  376 |     fail_if(list->len != 2, "Intersect of (doc ^ doc2)"
#      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  377 |             " should have 2 categories  have %d", list->len);
#      |                                                   ~~~~~~~~~
#      |                                                       |
#      |                                                       size_t {aka long unsigned int}
#  374|       COMPS_OBJECT_DESTROY(list);
#  375|       list = comps_doc_categories(tmpdoc);
#  376|->     fail_if(list->len != 2, "Intersect of (doc ^ doc2)"
#  377|               " should have 2 categories  have %d", list->len);
#  378|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING (CWE-685): [#def202]
libcomps-0.1.21/libcomps/tests/check_comps.c:380:29: warning[-Wformat-extra-args]: too many arguments for format
#  378|       COMPS_OBJECT_DESTROY(list);
#  379|       list = comps_doc_environments(tmpdoc);
#  380|->     fail_if(list->len != 2, "Intersect of "
#  381|               "(doc ^ doc2) should have 2 environments  have %d", list->len);
#  382|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def203]
libcomps-0.1.21/libcomps/tests/check_comps.c:380:29: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#  380 |     fail_if(list->len != 2, "Intersect of "
#      |                             ^~~~~~~~~~~~~~~
#  381 |             "(doc ^ doc2) should have 2 environments  have %d", list->len);
#      |                                                                 ~~~~~~~~~
#      |                                                                     |
#      |                                                                     size_t {aka long unsigned int}
#  378|       COMPS_OBJECT_DESTROY(list);
#  379|       list = comps_doc_environments(tmpdoc);
#  380|->     fail_if(list->len != 2, "Intersect of "
#  381|               "(doc ^ doc2) should have 2 environments  have %d", list->len);
#  382|       COMPS_OBJECT_DESTROY(list);

Error: COMPILER_WARNING: [#def204]
libcomps-0.1.21/libcomps/tests/check_parse.c:20: included_from: Included from here.
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘test_comps_parse1_fn’
libcomps-0.1.21/libcomps/tests/check_parse.c:89:38: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#   89 |     ck_assert_msg(tmplist->len == 3, "Should have 3 groups parsed."
#      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   90 |             "Have %d", tmplist->len);
#      |                        ~~~~~~~~~~~~   
#      |                               |
#      |                               size_t {aka long unsigned int}
#   87|       }
#   88|       tmplist = comps_doc_groups(parsed->comps_doc);
#   89|->     ck_assert_msg(tmplist->len == 3, "Should have 3 groups parsed."
#   90|               "Have %d", tmplist->len);
#   91|       COMPS_OBJECT_DESTROY(tmplist);

Error: COMPILER_WARNING: [#def205]
libcomps-0.1.21/libcomps/tests/check_parse.c:93:38: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#   93 |     ck_assert_msg(tmplist->len == 2, "Should have 2 categories"
#      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
#   94 |             "parsed. Have %d", tmplist->len);
#      |                                ~~~~~~~~~~~~
#      |                                       |
#      |                                       size_t {aka long unsigned int}
#   91|       COMPS_OBJECT_DESTROY(tmplist);
#   92|       tmplist = comps_doc_categories(parsed->comps_doc);
#   93|->     ck_assert_msg(tmplist->len == 2, "Should have 2 categories"
#   94|               "parsed. Have %d", tmplist->len);
#   95|       COMPS_OBJECT_DESTROY(tmplist);

Error: COMPILER_WARNING (CWE-685): [#def206]
libcomps-0.1.21/libcomps/tests/check_parse.c:98:13: warning[-Wformat-extra-args]: too many arguments for format
#   98 |             "Should have 1 environment parsed. Have %d", tmplist->len);
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   96|       tmplist = comps_doc_environments(parsed->comps_doc);
#   97|       fail_if(tmplist->len != 1,
#   98|->             "Should have 1 environment parsed. Have %d", tmplist->len);
#   99|       COMPS_OBJECT_DESTROY(tmplist);
#  100|   

Error: COMPILER_WARNING: [#def207]
libcomps-0.1.21/libcomps/tests/check_parse.c:98:13: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’}
#   98 |             "Should have 1 environment parsed. Have %d", tmplist->len);
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~
#      |                                                                 |
#      |                                                                 size_t {aka long unsigned int}
libcomps-0.1.21/libcomps/tests/check_parse.c:98:54: note: format string is defined here
#   98 |             "Should have 1 environment parsed. Have %d", tmplist->len);
#      |                                                     ~^
#      |                                                      |
#      |                                                      int
#      |                                                     %ld
#   96|       tmplist = comps_doc_environments(parsed->comps_doc);
#   97|       fail_if(tmplist->len != 1,
#   98|->             "Should have 1 environment parsed. Have %d", tmplist->len);
#   99|       COMPS_OBJECT_DESTROY(tmplist);
#  100|   

Error: COMPILER_WARNING (CWE-685): [#def208]
libcomps-0.1.21/libcomps/tests/check_parse.c:105:34: warning[-Wformat-extra-args]: too many arguments for format
#  105 |         fail_if(tmpobj2 == NULL, "Group not found");
#      |                                  ^~~~~~~~~~~~~~~~~
#  103|           tmplist = comps_doc_groups(parsed->comps_doc);
#  104|           tmpobj2 = comps_objlist_get_x(tmplist, i);
#  105|->         fail_if(tmpobj2 == NULL, "Group not found");
#  106|           tmpobj = comps_docgroup_get_id((COMPS_DocGroup*)tmpobj2);
#  107|           tmpstr = comps_object_tostr(tmpobj);

Error: COMPILER_WARNING (CWE-685): [#def209]
libcomps-0.1.21/libcomps/tests/check_parse.c:109:24: warning[-Wformat-extra-args]: too many arguments for format
#  109 |                        "%d.group should have id:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  107|           tmpstr = comps_object_tostr(tmpobj);
#  108|           fail_if(strcmp(tmpstr, groups_ids[i]) != 0,
#  109|->                        "%d.group should have id:%s not %s",
#  110|                           i, groups_ids[i], tmpstr);
#  111|           free(tmpstr);

Error: COMPILER_WARNING (CWE-685): [#def210]
libcomps-0.1.21/libcomps/tests/check_parse.c:117:24: warning[-Wformat-extra-args]: too many arguments for format
#  117 |                        "%d.group should have name:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  115|           tmpstr = comps_object_tostr(tmpobj);
#  116|           fail_if(strcmp(tmpstr, groups_names[i]) != 0,
#  117|->                        "%d.group should have name:%s not %s",
#  118|                           i, groups_names[i], tmpstr);
#  119|           free(tmpstr);

Error: COMPILER_WARNING (CWE-685): [#def211]
libcomps-0.1.21/libcomps/tests/check_parse.c:125:24: warning[-Wformat-extra-args]: too many arguments for format
#  125 |                        "%d.group should have desc:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  123|           tmpstr = comps_object_tostr(tmpobj);
#  124|           fail_if(strcmp(tmpstr, groups_descs[i]) != 0,
#  125|->                        "%d.group should have desc:%s not %s",
#  126|                           i, groups_descs[i], tmpstr);
#  127|           free(tmpstr);

Error: COMPILER_WARNING (CWE-195): [#def212]
libcomps-0.1.21/libcomps/tests/check_parse.c:133:38: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
#  133 |         fail_if(group_packages[i][0] != tmplist->len, "Group #%d should have"
#      |                                      ^~
#  131|           tmplist = comps_docgroup_get_packages((COMPS_DocGroup*)tmpobj2, NULL,
#  132|                                                COMPS_PACKAGE_DEFAULT);
#  133|->         fail_if(group_packages[i][0] != tmplist->len, "Group #%d should have"
#  134|                   " %d default packages, Have %d", i, group_packages[i][0],
#  135|                   tmplist->len);

Error: COMPILER_WARNING (CWE-685): [#def213]
libcomps-0.1.21/libcomps/tests/check_parse.c:133:55: warning[-Wformat-extra-args]: too many arguments for format
#  131|           tmplist = comps_docgroup_get_packages((COMPS_DocGroup*)tmpobj2, NULL,
#  132|                                                COMPS_PACKAGE_DEFAULT);
#  133|->         fail_if(group_packages[i][0] != tmplist->len, "Group #%d should have"
#  134|                   " %d default packages, Have %d", i, group_packages[i][0],
#  135|                   tmplist->len);

Error: COMPILER_WARNING: [#def214]
libcomps-0.1.21/libcomps/tests/check_parse.c:133:55: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘size_t’ {aka ‘long unsigned int’}
#  133 |         fail_if(group_packages[i][0] != tmplist->len, "Group #%d should have"
#      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~
#  134 |                 " %d default packages, Have %d", i, group_packages[i][0],
#  135 |                 tmplist->len);
#      |                 ~~~~~~~~~~~~                           
#      |                        |
#      |                        size_t {aka long unsigned int}
#  131|           tmplist = comps_docgroup_get_packages((COMPS_DocGroup*)tmpobj2, NULL,
#  132|                                                COMPS_PACKAGE_DEFAULT);
#  133|->         fail_if(group_packages[i][0] != tmplist->len, "Group #%d should have"
#  134|                   " %d default packages, Have %d", i, group_packages[i][0],
#  135|                   tmplist->len);

Error: COMPILER_WARNING (CWE-195): [#def215]
libcomps-0.1.21/libcomps/tests/check_parse.c:139:38: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’}
#  139 |         fail_if(group_packages[i][1] != tmplist->len, "Group #%d should have"
#      |                                      ^~
#  137|           tmplist = comps_docgroup_get_packages((COMPS_DocGroup*)tmpobj2, NULL,
#  138|                                                COMPS_PACKAGE_OPTIONAL);
#  139|->         fail_if(group_packages[i][1] != tmplist->len, "Group #%d should have"
#  140|                   " %d optional packages, Have %d", i, group_packages[i][1],
#  141|                   tmplist->len);

Error: COMPILER_WARNING (CWE-685): [#def216]
libcomps-0.1.21/libcomps/tests/check_parse.c:139:55: warning[-Wformat-extra-args]: too many arguments for format
#  137|           tmplist = comps_docgroup_get_packages((COMPS_DocGroup*)tmpobj2, NULL,
#  138|                                                COMPS_PACKAGE_OPTIONAL);
#  139|->         fail_if(group_packages[i][1] != tmplist->len, "Group #%d should have"
#  140|                   " %d optional packages, Have %d", i, group_packages[i][1],
#  141|                   tmplist->len);

Error: COMPILER_WARNING: [#def217]
libcomps-0.1.21/libcomps/tests/check_parse.c:139:55: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘size_t’ {aka ‘long unsigned int’}
#  139 |         fail_if(group_packages[i][1] != tmplist->len, "Group #%d should have"
#      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~
#  140 |                 " %d optional packages, Have %d", i, group_packages[i][1],
#  141 |                 tmplist->len);
#      |                 ~~~~~~~~~~~~                           
#      |                        |
#      |                        size_t {aka long unsigned int}
#  137|           tmplist = comps_docgroup_get_packages((COMPS_DocGroup*)tmpobj2, NULL,
#  138|                                                COMPS_PACKAGE_OPTIONAL);
#  139|->         fail_if(group_packages[i][1] != tmplist->len, "Group #%d should have"
#  140|                   " %d optional packages, Have %d", i, group_packages[i][1],
#  141|                   tmplist->len);

Error: COMPILER_WARNING (CWE-685): [#def218]
libcomps-0.1.21/libcomps/tests/check_parse.c:150:24: warning[-Wformat-extra-args]: too many arguments for format
#  150 |                        "%s. category should have id:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  148|           tmpstr = comps_object_tostr(tmpobj);
#  149|           fail_if(strcmp(tmpstr, cats_ids[i]) != 0,
#  150|->                        "%s. category should have id:%s not %s",
#  151|                           i, cats_ids[i], tmpstr);
#  152|           free(tmpstr);

Error: COMPILER_WARNING: [#def219]
libcomps-0.1.21/libcomps/tests/check_parse.c:150:24: warning[-Wformat=]: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘int’
#  150 |                        "%s. category should have id:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  151 |                         i, cats_ids[i], tmpstr);
#      |                         ~
#      |                         |
#      |                         int
libcomps-0.1.21/libcomps/tests/check_parse.c:150:26: note: format string is defined here
#  150 |                        "%s. category should have id:%s not %s",
#      |                         ~^
#      |                          |
#      |                          char *
#      |                         %d
#  148|           tmpstr = comps_object_tostr(tmpobj);
#  149|           fail_if(strcmp(tmpstr, cats_ids[i]) != 0,
#  150|->                        "%s. category should have id:%s not %s",
#  151|                           i, cats_ids[i], tmpstr);
#  152|           free(tmpstr);

Error: COMPILER_WARNING (CWE-685): [#def220]
libcomps-0.1.21/libcomps/tests/check_parse.c:158:24: warning[-Wformat-extra-args]: too many arguments for format
#  158 |                        "%s. category should have name:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  156|           tmpstr = comps_object_tostr(tmpobj);
#  157|           fail_if(strcmp(tmpstr, cats_names[i]) != 0,
#  158|->                        "%s. category should have name:%s not %s",
#  159|                           i, cats_names[i], tmpstr);
#  160|           free(tmpstr);

Error: COMPILER_WARNING: [#def221]
libcomps-0.1.21/libcomps/tests/check_parse.c:158:24: warning[-Wformat=]: format ‘%s’ expects argument of type ‘char *’, but argument 5 has type ‘int’
#  158 |                        "%s. category should have name:%s not %s",
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  159 |                         i, cats_names[i], tmpstr);
#      |                         ~
#      |                         |
#      |                         int
libcomps-0.1.21/libcomps/tests/check_parse.c:158:26: note: format string is defined here
#  158 |                        "%s. category should have name:%s not %s",
#      |                         ~^
#      |                          |
#      |                          char *
#      |                         %d
#  156|           tmpstr = comps_object_tostr(tmpobj);
#  157|           fail_if(strcmp(tmpstr, cats_names[i]) != 0,
#  158|->                        "%s. category should have name:%s not %s",
#  159|                           i, cats_names[i], tmpstr);
#  160|           free(tmpstr);

Error: COMPILER_WARNING (CWE-195): [#def222]
libcomps-0.1.21/libcomps/tests/check_parse.c:163:63: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’
#  163 |         fail_if(((COMPS_DocCategory*)tmpobj2)->group_ids->len != cats_gids[i],
#      |                                                               ^~
#  161|           COMPS_OBJECT_DESTROY(tmpobj);
#  162|   
#  163|->         fail_if(((COMPS_DocCategory*)tmpobj2)->group_ids->len != cats_gids[i],
#  164|                   "Category #%d should have %d groupids, have %d", i,
#  165|                   cats_gids[i], ((COMPS_DocCategory*)tmpobj2)->group_ids->len);

Error: COMPILER_WARNING (CWE-685): [#def223]
libcomps-0.1.21/libcomps/tests/check_parse.c:164:17: warning[-Wformat-extra-args]: too many arguments for format
#  164 |                 "Category #%d should have %d groupids, have %d", i,
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  162|   
#  163|           fail_if(((COMPS_DocCategory*)tmpobj2)->group_ids->len != cats_gids[i],
#  164|->                 "Category #%d should have %d groupids, have %d", i,
#  165|                   cats_gids[i], ((COMPS_DocCategory*)tmpobj2)->group_ids->len);
#  166|           COMPS_OBJECT_DESTROY(tmpobj2);

Error: COMPILER_WARNING: [#def224]
libcomps-0.1.21/libcomps/tests/check_parse.c:164:17: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘size_t’ {aka ‘long unsigned int’}
#  164 |                 "Category #%d should have %d groupids, have %d", i,
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  165 |                 cats_gids[i], ((COMPS_DocCategory*)tmpobj2)->group_ids->len);
#      |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#      |                                                                       |
#      |                                                                       size_t {aka long unsigned int}
libcomps-0.1.21/libcomps/tests/check_parse.c:164:62: note: format string is defined here
#  164 |                 "Category #%d should have %d groupids, have %d", i,
#      |                                                             ~^
#      |                                                              |
#      |                                                              int
#      |                                                             %ld
#  162|   
#  163|           fail_if(((COMPS_DocCategory*)tmpobj2)->group_ids->len != cats_gids[i],
#  164|->                 "Category #%d should have %d groupids, have %d", i,
#  165|                   cats_gids[i], ((COMPS_DocCategory*)tmpobj2)->group_ids->len);
#  166|           COMPS_OBJECT_DESTROY(tmpobj2);

Error: COMPILER_WARNING (CWE-685): [#def225]
libcomps-0.1.21/libcomps/tests/check_parse.c:177:21: warning[-Wformat-extra-args]: too many arguments for format
#  177 |     fail_if(ret >0, "XML shouldn't be valid. Validation returned: %d", ret);
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  175|       comps_parse_file(parsed, fp, NULL);
#  176|       ret = comps_parse_validate_dtd("sample-bad-elem.xml", "comps.dtd");
#  177|->     fail_if(ret >0, "XML shouldn't be valid. Validation returned: %d", ret);
#  178|   
#  179|       if (parsed->log->entries->first != NULL) {

Error: COMPILER_WARNING (CWE-685): [#def226]
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘check_errors’
libcomps-0.1.21/libcomps/tests/check_parse.c:198:17: warning[-Wformat-extra-args]: too many arguments for format
#  198 |                 "%d err opt_message doesn't match (%d != %d)", i,
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  196|           fail_if(((COMPS_LogEntry*)it->data)->arg_count !=
#  197|                   known_errors[i]->arg_count,
#  198|->                 "%d err opt_message doesn't match (%d != %d)", i,
#  199|                   ((COMPS_LogEntry*)it->data)->arg_count,
#  200|                   known_errors[i]->arg_count);

Error: COMPILER_WARNING (CWE-685): [#def227]
libcomps-0.1.21/libcomps/tests/check_parse.c:202:44: warning[-Wformat-extra-args]: too many arguments for format
#  202 |                     known_errors[i]->code, "%d. err code different\n (%d != %d)",
#      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  200|                   known_errors[i]->arg_count);
#  201|           fail_if(((COMPS_LogEntry*)it->data)->code !=
#  202|->                     known_errors[i]->code, "%d. err code different\n (%d != %d)",
#  203|                       i, ((COMPS_LogEntry*)it->data)->code,
#  204|                       known_errors[i]->code);

Error: COMPILER_WARNING (CWE-685): [#def228]
libcomps-0.1.21/libcomps/tests/check_parse.c:210:70: warning[-Wformat-extra-args]: too many arguments for format
#  210 |                                      known_errors[i]->args[x]) == 0, "%d. %s != %s",
#      |                                                                      ^~~~~~~~~~~~~~
#  208|               _y = comps_object_tostr(known_errors[i]->args[x]);
#  209|               fail_if(comps_object_cmp(((COMPS_LogEntry*)it->data)->args[x],
#  210|->                                      known_errors[i]->args[x]) == 0, "%d. %s != %s",
#  211|                                        x, _x, _y);
#  212|               free(_x);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def229]
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘__log_entry_x’
libcomps-0.1.21/libcomps/tests/check_parse.c:233:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown>.args + (long unsigned int)i * 8’
#  231|       for (int i=0; i<n; i++) {
#  232|           val = va_arg(arg_list, COMPS_Object*);
#  233|->         entry->args[i] = val;
#  234|       }
#  235|       va_end(arg_list);

Error: COMPILER_WARNING: [#def230]
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘test_comps_parse3_fn’
libcomps-0.1.21/libcomps/tests/check_parse.c:344:21: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘void *’
#  344 |     fail_if(tmpobj, "%d. category should have NULL id\n");
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcomps-0.1.21/libcomps/tests/check_parse.c:344:23: note: format string is defined here
#  344 |     fail_if(tmpobj, "%d. category should have NULL id\n");
#      |                      ~^
#      |                       |
#      |                       int
#      |                      %p
#  342|   
#  343|       tmpobj = comps_docgroup_get_id((COMPS_DocGroup*)it->comps_obj);
#  344|->     fail_if(tmpobj, "%d. category should have NULL id\n");
#  345|       COMPS_OBJECT_DESTROY(tmpobj);
#  346|       tmpobj = comps_docgroup_get_name((COMPS_DocGroup*)it->comps_obj);

Error: COMPILER_WARNING: [#def231]
libcomps-0.1.21/libcomps/tests/check_parse.c:347:21: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘void *’
#  347 |     fail_if(tmpobj, "%d. category should have NULL name\n");
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcomps-0.1.21/libcomps/tests/check_parse.c:347:23: note: format string is defined here
#  347 |     fail_if(tmpobj, "%d. category should have NULL name\n");
#      |                      ~^
#      |                       |
#      |                       int
#      |                      %p
#  345|       COMPS_OBJECT_DESTROY(tmpobj);
#  346|       tmpobj = comps_docgroup_get_name((COMPS_DocGroup*)it->comps_obj);
#  347|->     fail_if(tmpobj, "%d. category should have NULL name\n");
#  348|       COMPS_OBJECT_DESTROY(tmpobj);
#  349|       tmpobj = comps_docgroup_get_desc((COMPS_DocGroup*)it->comps_obj);

Error: COMPILER_WARNING: [#def232]
libcomps-0.1.21/libcomps/tests/check_parse.c:350:21: warning[-Wformat=]: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘void *’
#  350 |     fail_if(tmpobj, "%d. category should have NULL description\n");
#      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libcomps-0.1.21/libcomps/tests/check_parse.c:350:23: note: format string is defined here
#  350 |     fail_if(tmpobj, "%d. category should have NULL description\n");
#      |                      ~^
#      |                       |
#      |                       int
#      |                      %p
#  348|       COMPS_OBJECT_DESTROY(tmpobj);
#  349|       tmpobj = comps_docgroup_get_desc((COMPS_DocGroup*)it->comps_obj);
#  350|->     fail_if(tmpobj, "%d. category should have NULL description\n");
#  351|       COMPS_OBJECT_DESTROY(tmpobj);
#  352|       comps_parse_parsed_destroy(parsed);

Error: COMPILER_WARNING (CWE-685): [#def233]
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘test_comps_fedora_parse_fn’
libcomps-0.1.21/libcomps/tests/check_parse.c:479:39: warning[-Wformat-extra-args]: too many arguments for format
#  479 |     fail_if(parsed->fatal_error != 0, "Some fatal errors found after parsing");
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  477|       comps_parse_file(parsed, fp, NULL);
#  478|       //printf("log len:%d\n", parsed->log->logger_data->len);
#  479|->     fail_if(parsed->fatal_error != 0, "Some fatal errors found after parsing");
#  480|       //printf("log len:%d\n", parsed->log->logger_data->len);
#  481|       //err_str = comps_log_str(parsed->log);

Error: COMPILER_WARNING (CWE-685): [#def234]
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘test_main2_fn’
libcomps-0.1.21/libcomps/tests/check_parse.c:507:39: warning[-Wformat-extra-args]: too many arguments for format
#  507 |     fail_if(parsed->fatal_error != 0, "Some fatal errors found after parsing");
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  505|       fp = fopen("main_comps2.xml", "r");
#  506|       comps_parse_file(parsed, fp, NULL);
#  507|->     fail_if(parsed->fatal_error != 0, "Some fatal errors found after parsing");
#  508|       //comps2xml_f(parsed->comps_doc, "fed2.xml", 0);
#  509|       comps_parse_parsed_destroy(parsed);

Error: COMPILER_WARNING (CWE-685): [#def235]
libcomps-0.1.21/libcomps/tests/check_parse.c: scope_hint: In function ‘test_arch_fn’
libcomps-0.1.21/libcomps/tests/check_parse.c:557:39: warning[-Wformat-extra-args]: too many arguments for format
#  557 |     fail_if(parsed->fatal_error != 0, "Some fatal errors found after parsing");
#      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  555|       comps_parse_file(parsed, fp, NULL);
#  556|       //comps_log_print(parsed->log);
#  557|->     fail_if(parsed->fatal_error != 0, "Some fatal errors found after parsing");
#  558|       //comps2xml_f(parsed->comps_doc, "fed2.xml", 0);
#  559|       arches = (COMPS_ObjList*)comps_object_create(&COMPS_ObjList_ObjInfo, NULL);

Error: CLANG_WARNING: [#def236]
libcomps-0.1.21/libcomps/tests/check_parse.c:570:23: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  568|           g = (COMPS_DocGroup*)it->comps_obj;
#  569|           str = (COMPS_Str*)comps_docgroup_get_id(g);
#  570|->         ck_assert_msg(strcmp(str->val, grps[0][x]) == 0, "%s != %s",
#  571|                         str->val, grps[0][x]);
#  572|           COMPS_OBJECT_DESTROY(str);

Error: CLANG_WARNING: [#def237]
libcomps-0.1.21/libcomps/tests/check_parse.c:574:26: warning[core.NullDereference]: Access to field 'comps_obj' results in a dereference of a null pointer (loaded from field 'first')
#  572|           COMPS_OBJECT_DESTROY(str);
#  573|       }
#  574|->     g = (COMPS_DocGroup*)list->first->comps_obj;
#  575|       list2 = g->packages;
#  576|       for (x=0, it = list2->first; it != NULL; it = it->next, x++) {

Error: CLANG_WARNING: [#def238]
libcomps-0.1.21/libcomps/tests/check_parse.c:590:23: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  588|           c = (COMPS_DocCategory*)it->comps_obj;
#  589|           str = (COMPS_Str*)comps_doccategory_get_id(c);
#  590|->         ck_assert_msg(strcmp(str->val, cats[0][x]) == 0, "%s != %s",
#  591|                         str->val, cats[0][x]);
#  592|           COMPS_OBJECT_DESTROY(str);

Error: CLANG_WARNING: [#def239]
libcomps-0.1.21/libcomps/tests/check_parse.c:594:29: warning[core.NullDereference]: Access to field 'comps_obj' results in a dereference of a null pointer (loaded from field 'first')
#  592|           COMPS_OBJECT_DESTROY(str);
#  593|       }
#  594|->     c = (COMPS_DocCategory*)list->first->comps_obj;
#  595|       list2 = c->group_ids;
#  596|       for (x=0, it = list2->first; it != NULL; it = it->next, x++) {

Error: CLANG_WARNING: [#def240]
libcomps-0.1.21/libcomps/tests/check_parse.c:610:23: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  608|           e = (COMPS_DocEnv*)it->comps_obj;
#  609|           str = (COMPS_Str*)comps_docenv_get_id(e);
#  610|->         ck_assert_msg(strcmp(str->val, envs[0][x]) == 0, "%s != %s",
#  611|                         str->val, envs[0][x]);
#  612|           COMPS_OBJECT_DESTROY(str);

Error: CLANG_WARNING: [#def241]
libcomps-0.1.21/libcomps/tests/check_parse.c:614:24: warning[core.NullDereference]: Access to field 'comps_obj' results in a dereference of a null pointer (loaded from field 'first')
#  612|           COMPS_OBJECT_DESTROY(str);
#  613|       }
#  614|->     e = (COMPS_DocEnv*)list->first->comps_obj;
#  615|       list2 = e->group_list;
#  616|       for (x=0, it = list2->first; it != NULL; it = it->next, x++) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def242]
libcomps-0.1.21/libcomps/tests/check_rtree.c:40:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
libcomps-0.1.21/libcomps/tests/check_rtree.c: scope_hint: In function ‘main’
#   38|   void* int_cloner(void * int_v) {
#   39|       void * ret = malloc(sizeof(int));
#   40|->     memcpy(ret, int_v, sizeof(int));
#   41|       return ret;
#   42|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def243]
libcomps-0.1.21/libcomps/tests/check_rtree.c: scope_hint: In function ‘str_cloner’
libcomps-0.1.21/libcomps/tests/check_rtree.c:46:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ret’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#   44|   void* str_cloner(void *str) {
#   45|       void *ret = malloc(sizeof(char)* (strlen((char*)str)+1));
#   46|->     memcpy(ret, str, (strlen((char*)str)+1));
#   47|       return ret;
#   48|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def244]
libcomps-0.1.21/libcomps/tests/check_utils.c: scope_hint: In function ‘print_package’
libcomps-0.1.21/libcomps/tests/check_utils.c:51:5: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of ‘__builtin_puts’ must be non-null
#   49|       printf("%s type=", str);
#   50|       free(str);
#   51|->     printf("%s\n", pkg_type2str(((COMPS_DocGroupPackage*)obj)->type));
#   52|   }
#   53|   

Scan Properties

analyzer-version-clang18.1.3
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-141.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibcomps-0.1.21-1.fc41
store-results-to/tmp/tmpwm89f9ej/libcomps-0.1.21-1.fc41.tar.xz
time-created2024-04-22 10:56:21
time-finished2024-04-22 10:58:34
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpwm89f9ej/libcomps-0.1.21-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpwm89f9ej/libcomps-0.1.21-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9