Task #1596 - libplist-2.3.0-4.fc40/scan-results.err
back to task #1596download
Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/cython/plist.c: warning: -Wno-implicit-function-declaration detected - is this intentional ? Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:30480:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #30480 | }; # | ^ /usr/include/python3.13/object.h:1224: included_from: Included from here. /usr/include/python3.13/Python.h:68: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:16: included_from: Included from here. /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #30478| 0, /*tp_pypy_flags*/ #30479| #endif #30480|-> }; #30481| #endif #30482| static struct __pyx_vtabstruct_5plist_Bool __pyx_vtable_5plist_Bool; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:30674:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #30674 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #30672| 0, /*tp_pypy_flags*/ #30673| #endif #30674|-> }; #30675| #endif #30676| static struct __pyx_vtabstruct_5plist_Integer __pyx_vtable_5plist_Integer; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:30872:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #30872 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #30870| 0, /*tp_pypy_flags*/ #30871| #endif #30872|-> }; #30873| #endif #30874| static struct __pyx_vtabstruct_5plist_Uid __pyx_vtable_5plist_Uid; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:31070:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #31070 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #31068| 0, /*tp_pypy_flags*/ #31069| #endif #31070|-> }; #31071| #endif #31072| static struct __pyx_vtabstruct_5plist_Key __pyx_vtable_5plist_Key; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:31201:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #31201 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #31199| 0, /*tp_pypy_flags*/ #31200| #endif #31201|-> }; #31202| #endif #31203| static struct __pyx_vtabstruct_5plist_Real __pyx_vtable_5plist_Real; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:31399:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #31399 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #31397| 0, /*tp_pypy_flags*/ #31398| #endif #31399|-> }; #31400| #endif #31401| static struct __pyx_vtabstruct_5plist_String __pyx_vtable_5plist_String; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:31530:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #31530 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #31528| 0, /*tp_pypy_flags*/ #31529| #endif #31530|-> }; #31531| #endif #31532| static struct __pyx_vtabstruct_5plist_Date __pyx_vtable_5plist_Date; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:31661:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #31661 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #31659| 0, /*tp_pypy_flags*/ #31660| #endif #31661|-> }; #31662| #endif #31663| static struct __pyx_vtabstruct_5plist_Data __pyx_vtable_5plist_Data; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:31792:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #31792 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #31790| 0, /*tp_pypy_flags*/ #31791| #endif #31792|-> }; #31793| #endif #31794| static struct __pyx_vtabstruct_5plist_Dict __pyx_vtable_5plist_Dict; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:32007:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #32007 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #32005| 0, /*tp_pypy_flags*/ #32006| #endif #32007|-> }; #32008| #endif #32009| static struct __pyx_vtabstruct_5plist_Array __pyx_vtable_5plist_Array; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:32214:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #32214 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #32212| 0, /*tp_pypy_flags*/ #32213| #endif #32214|-> }; #32215| #endif #32216| static struct __pyx_vtabstruct_5plist_Null __pyx_vtable_5plist_Null; Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:32344:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #32344 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #32342| 0, /*tp_pypy_flags*/ #32343| #endif #32344|-> }; #32345| #endif #32346| Error: COMPILER_WARNING (CWE-909): libplist-2.3.0-build/libplist-2.3.0/cython/plist.c:39333:1: warning[-Wmissing-field-initializers]: missing initializer for field 'tp_versions_used' of 'PyTypeObject' {aka 'struct _typeobject'} #39333 | }; # | ^ /usr/include/python3.13/cpython/object.h:232:14: note: 'tp_versions_used' declared here # 232 | uint16_t tp_versions_used; # | ^~~~~~~~~~~~~~~~ #39331| 0, #39332| #endif #39333|-> }; #39334| #endif #39335| static int __pyx_CyFunction_init(PyObject *module) { Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/cython/plist_util.c: warning: -Wno-implicit-function-declaration detected - is this intentional ? Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/libcnary/node.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/libcnary/node_list.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/base64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/base64.c: scope_hint: In function 'base64decode' libplist-2.3.0-build/libplist-2.3.0/src/base64.c:105:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'outbuf' # 103| # 104| if (w1 >= 0 && w2 >= 0) { # 105|-> outbuf[p++] = (unsigned char)(((w1 << 2) + (w2 >> 4)) & 0xFF); # 106| } # 107| if (w2 >= 0 && w3 >= 0) { Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/base64.c:108:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'outbuf' # 106| } # 107| if (w2 >= 0 && w3 >= 0) { # 108|-> outbuf[p++] = (unsigned char)(((w2 << 4) + (w3 >> 2)) & 0xFF); # 109| } # 110| if (w3 >= 0 && w4 >= 0) { Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/base64.c:111:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'outbuf' # 109| } # 110| if (w3 >= 0 && w4 >= 0) { # 111|-> outbuf[p++] = (unsigned char)(((w3 << 6) + w4) & 0xFF); # 112| } # 113| } Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/base64.c:116:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'outbuf' # 114| } while (1); # 115| # 116|-> outbuf[p] = 0; # 117| *size = p; # 118| return outbuf; Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/bplist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/bplist.c: scope_hint: In function 'parse_unicode_node' libplist-2.3.0-build/libplist-2.3.0/src/bplist.c:406:22: warning[-Wuse-after-free]: pointer 'tmpstr_29' may be used after 'realloc' # 406 | data->strval = tmpstr; # | ~~~~~~~~~~~~~^~~~~~~~ libplist-2.3.0-build/libplist-2.3.0/src/bplist.c:404:20: note: call to 'realloc' here # 404 | data->strval = realloc(tmpstr, items_written+1); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 404| data->strval = realloc(tmpstr, items_written+1); # 405| if (!data->strval) # 406|-> data->strval = tmpstr; # 407| data->length = items_written; # 408| return node_create(NULL, data); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/bplist.c:1234:5: warning[deadcode.DeadStores]: Value stored to 'offset_size' is never read # 1232| # 1233| //now stream to output buffer # 1234|-> offset_size = 0; //unknown yet # 1235| objects_len = objects->len; # 1236| ref_size = get_needed_bytes(objects_len); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/bplist.c:1239:5: warning[deadcode.DeadStores]: Value stored to 'offset_table_index' is never read # 1237| num_objects = objects->len; # 1238| root_object = 0; //root is first in list # 1239|-> offset_table_index = 0; //unknown yet # 1240| # 1241| //figure out the storage size required Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/bytearray.c: scope_hint: In function 'byte_array_new' libplist-2.3.0-build/libplist-2.3.0/src/bytearray.c:29:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'a' # 27| { # 28| bytearray_t *a = (bytearray_t*)malloc(sizeof(bytearray_t)); # 29|-> a->capacity = (initial > PAGE_SIZE) ? (initial+(PAGE_SIZE-1)) & (~(PAGE_SIZE-1)) : PAGE_SIZE; # 30| a->data = malloc(a->capacity); # 31| a->len = 0; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/bytearray.c: scope_hint: In function 'byte_array_new_for_stream' libplist-2.3.0-build/libplist-2.3.0/src/bytearray.c:39:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'a' # 37| { # 38| bytearray_t *a = (bytearray_t*)malloc(sizeof(bytearray_t)); # 39|-> a->capacity = (size_t)-1; # 40| a->data = NULL; # 41| a->len = 0; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/hashtable.c: scope_hint: In function 'hash_table_new' libplist-2.3.0-build/libplist-2.3.0/src/hashtable.c:30:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'ht' # 28| ht->entries[i] = NULL; # 29| } # 30|-> ht->count = 0; # 31| ht->hash_func = hash_func; # 32| ht->compare_func = compare_func; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/hashtable.c: scope_hint: In function 'hash_table_insert' libplist-2.3.0-build/libplist-2.3.0/src/hashtable.c:81:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'entry' # 79| // make a new entry. # 80| hashentry_t* entry = (hashentry_t*)malloc(sizeof(hashentry_t)); # 81|-> entry->key = key; # 82| entry->value = value; # 83| if (!ht->entries[idx0]) { Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/jplist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/jplist.c:398:15: warning[-Wenum-int-mismatch]: conflicting types for 'plist_to_json' due to enum/integer mismatch; have 'int(void *, char **, uint32_t *, int)' {aka 'int(void *, char **, unsigned int *, int)'} # 398 | PLIST_API int plist_to_json(plist_t plist, char **json, uint32_t* length, int prettify) # | ^~~~~~~~~~~~~ libplist-2.3.0-build/libplist-2.3.0/src/plist.h:29: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/src/jplist.c:38: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:754:17: note: previous declaration of 'plist_to_json' with type 'plist_err_t(void *, char **, uint32_t *, int)' {aka 'plist_err_t(void *, char **, unsigned int *, int)'} # 754 | plist_err_t plist_to_json(plist_t plist, char **plist_json, uint32_t* length, int prettify); # | ^~~~~~~~~~~~~ # 396| } # 397| # 398|-> PLIST_API int plist_to_json(plist_t plist, char **json, uint32_t* length, int prettify) # 399| { # 400| uint64_t size = 0; Error: GCC_ANALYZER_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/src/jplist.c: scope_hint: In function 'parse_object' libplist-2.3.0-build/libplist-2.3.0/src/jplist.c:576:19: warning[-Wanalyzer-malloc-leak]: leak of 'unescape_string(js + (sizetype)*<unknown>.start, (long unsigned int)(*<unknown>.end - _16->start), 0)' # 574| size_t i = 0; # 575| while (i < str_len) { # 576|-> if (strval[i] == '\\' && i < str_len-1) { # 577| switch (strval[i+1]) { # 578| case '\"': case '/' : case '\\' : case 'b' : Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/jplist.c: scope_hint: In function 'unescape_string' libplist-2.3.0-build/libplist-2.3.0/src/jplist.c:576:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'strval' # 574| size_t i = 0; # 575| while (i < str_len) { # 576|-> if (strval[i] == '\\' && i < str_len-1) { # 577| switch (strval[i+1]) { # 578| case '\"': case '/' : case '\\' : case 'b' : Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/jplist.c:782:15: warning[-Wenum-int-mismatch]: conflicting types for 'plist_from_json' due to enum/integer mismatch; have 'int(const char *, uint32_t, void **)' {aka 'int(const char *, unsigned int, void **)'} # 782 | PLIST_API int plist_from_json(const char *json, uint32_t length, plist_t * plist) # | ^~~~~~~~~~~~~~~ libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:798:17: note: previous declaration of 'plist_from_json' with type 'plist_err_t(const char *, uint32_t, void **)' {aka 'plist_err_t(const char *, unsigned int, void **)'} # 798 | plist_err_t plist_from_json(const char *json, uint32_t length, plist_t * plist); # | ^~~~~~~~~~~~~~~ # 780| } # 781| # 782|-> PLIST_API int plist_from_json(const char *json, uint32_t length, plist_t * plist) # 783| { # 784| if (!plist) { Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/jsmn.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/oplist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/oplist.c:442:15: warning[-Wenum-int-mismatch]: conflicting types for 'plist_to_openstep' due to enum/integer mismatch; have 'int(void *, char **, uint32_t *, int)' {aka 'int(void *, char **, unsigned int *, int)'} # 442 | PLIST_API int plist_to_openstep(plist_t plist, char **openstep, uint32_t* length, int prettify) # | ^~~~~~~~~~~~~~~~~ libplist-2.3.0-build/libplist-2.3.0/src/plist.h:29: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/src/oplist.c:38: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:767:17: note: previous declaration of 'plist_to_openstep' with type 'plist_err_t(void *, char **, uint32_t *, int)' {aka 'plist_err_t(void *, char **, unsigned int *, int)'} # 767 | plist_err_t plist_to_openstep(plist_t plist, char **plist_openstep, uint32_t* length, int prettify); # | ^~~~~~~~~~~~~~~~~ # 440| } # 441| # 442|-> PLIST_API int plist_to_openstep(plist_t plist, char **openstep, uint32_t* length, int prettify) # 443| { # 444| uint64_t size = 0; Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/oplist.c:895:15: warning[-Wenum-int-mismatch]: conflicting types for 'plist_from_openstep' due to enum/integer mismatch; have 'int(const char *, uint32_t, void **)' {aka 'int(const char *, unsigned int, void **)'} # 895 | PLIST_API int plist_from_openstep(const char *plist_ostep, uint32_t length, plist_t * plist) # | ^~~~~~~~~~~~~~~~~~~ libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:808:17: note: previous declaration of 'plist_from_openstep' with type 'plist_err_t(const char *, uint32_t, void **)' {aka 'plist_err_t(const char *, unsigned int, void **)'} # 808 | plist_err_t plist_from_openstep(const char *openstep, uint32_t length, plist_t * plist); # | ^~~~~~~~~~~~~~~~~~~ # 893| } # 894| # 895|-> PLIST_API int plist_from_openstep(const char *plist_ostep, uint32_t length, plist_t * plist) # 896| { # 897| if (!plist) { Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/out-default.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/src/out-default.c: scope_hint: In function 'node_to_string' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:246:27: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'val' where non-null expected libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:39: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:474:24: note: in expansion of macro 'str_buf_new_for_stream' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:158:13: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:160:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:158:13: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:160:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:185:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:187:21: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-default.c:29: included_from: Included from here. /usr/include/time.h:99:15: note: argument 1 of 'strftime' must be non-null # 244| struct tm _tmcopy; # 245| copy_TM64_to_tm(btime, &_tmcopy); # 246|-> val_len = strftime(val, 26, "%Y-%m-%d %H:%M:%S +0000", &_tmcopy); # 247| if (val_len > 0) { # 248| str_buf_append(*outbuf, val, val_len); Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c: scope_hint: In function 'node_to_string' libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:81:16: warning[-Wanalyzer-malloc-leak]: leak of 'val' libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:40: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:432:24: note: in expansion of macro 'str_buf_new_for_stream' # 79| # 80| if (!node) # 81|-> return PLIST_ERR_INVALID_ARG; # 82| # 83| node_data = plist_get_data(node); Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:214:27: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'val' where non-null expected libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:432:24: note: in expansion of macro 'str_buf_new_for_stream' libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:30: included_from: Included from here. /usr/include/time.h:99:15: note: argument 1 of 'strftime' must be non-null # 212| struct tm _tmcopy; # 213| copy_TM64_to_tm(btime, &_tmcopy); # 214|-> val_len = strftime(val, 24, "%Y-%m-%dT%H:%M:%SZ", &_tmcopy); # 215| if (val_len > 0) { # 216| str_buf_append(*outbuf, val, val_len); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/out-limd.c:240:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'val' # 238| } # 239| # 240|-> return PLIST_ERR_SUCCESS; # 241| } # 242| Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c: scope_hint: In function 'node_to_string' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:244:27: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'val' where non-null expected libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:39: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:448:24: note: in expansion of macro 'str_buf_new_for_stream' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:155:13: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:157:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:155:13: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:157:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:182:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:184:21: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:29: included_from: Included from here. /usr/include/time.h:99:15: note: argument 1 of 'strftime' must be non-null # 242| struct tm _tmcopy; # 243| copy_TM64_to_tm(btime, &_tmcopy); # 244|-> val_len = strftime(val, 26, "%Y-%m-%d %H:%M:%S +0000", &_tmcopy); # 245| if (val_len > 0) { # 246| str_buf_append(*outbuf, val, val_len); Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:256:23: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'val' where non-null expected libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:448:24: note: in expansion of macro 'str_buf_new_for_stream' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:155:13: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:157:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:155:13: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:157:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:182:17: note: in expansion of macro 'str_buf_append' libplist-2.3.0-build/libplist-2.3.0/src/out-plutil.c:184:21: note: in expansion of macro 'str_buf_append' <built-in>: note: argument 1 of '__builtin_sprintf' must be non-null # 254| { # 255| val = (char*)malloc(88); # 256|-> val_len = sprintf(val, "<CFKeyedArchiverUID %p [%p]>{value = %" PRIu64 "}", node, node_data, node_data->intval); # 257| str_buf_append(*outbuf, val, val_len); # 258| free(val); Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/plist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/plist.c:221:29: warning[core.UndefinedBinaryOperatorResult]: The left operand of '==' is a garbage value # 219| /* skip whitespace */ # 220| SKIP_WS(plist_data, pos, length); # 221|-> if (plist_data[pos] == '<' && (length-pos > 3) && !isxdigit(plist_data[pos+1]) && !isxdigit(plist_data[pos+2]) && !isxdigit(plist_data[pos+3])) { # 222| is_xml = 1; # 223| } else if (plist_data[pos] == '[') { Error: COMPILER_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/plist.c: scope_hint: In function 'plist_new_plist_data' libplist-2.3.0-build/libplist-2.3.0/src/plist.c:324:54: warning[-Wcalloc-transposed-args]: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument # 324 | plist_data_t data = (plist_data_t) calloc(sizeof(struct plist_data_s), 1); # | ^~~~~~ libplist-2.3.0-build/libplist-2.3.0/src/plist.c:324:54: note: earlier argument should specify number of elements, later size of each element # 322| plist_data_t plist_new_plist_data(void) # 323| { # 324|-> plist_data_t data = (plist_data_t) calloc(sizeof(struct plist_data_s), 1); # 325| return data; # 326| } Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/plist.c: scope_hint: In function 'plist_new_key' libplist-2.3.0-build/libplist-2.3.0/src/plist.c:417:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'data' libplist-2.3.0-build/libplist-2.3.0/src/plist.c: scope_hint: In function 'plist_new_key' # 415| { # 416| plist_data_t data = plist_new_plist_data(); # 417|-> data->type = PLIST_KEY; # 418| data->strval = strdup(val); # 419| data->length = strlen(val); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/plist.c:1617:13: warning[deadcode.DeadStores]: Value stored to 'lptr' is never read # 1615| cur_key = NEXT_KEY(cur_key); # 1616| } # 1617|-> lptr = cur_key; # 1618| } while (swapped); # 1619| } Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/src/ptrarray.c: scope_hint: In function 'ptr_array_new' libplist-2.3.0-build/libplist-2.3.0/src/ptrarray.c:27:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'pa' # 25| { # 26| ptrarray_t *pa = (ptrarray_t*)malloc(sizeof(ptrarray_t)); # 27|-> pa->pdata = (void**)malloc(sizeof(void*) * capacity); # 28| pa->capacity = capacity; # 29| pa->capacity_step = (capacity > 4096) ? 4096 : capacity; Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/time64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/time64.c:278:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '<=' is a garbage value # 276| # 277| assert(tm->tm_mday >= 1); # 278|-> assert(tm->tm_mday <= days_in_month[IS_LEAP(tm->tm_year)][tm->tm_mon]); # 279| # 280| assert(tm->tm_mon >= 0); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/time64.c:278:24: warning[core.UndefinedBinaryOperatorResult]: The right operand of '<=' is a garbage value due to array index out of bounds # 276| # 277| assert(tm->tm_mday >= 1); # 278|-> assert(tm->tm_mday <= days_in_month[IS_LEAP(tm->tm_year)][tm->tm_mon]); # 279| # 280| assert(tm->tm_mon >= 0); Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:763:21: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 761| ctx->pos += 3; # 762| } else { # 763|-> p = ctx->pos; # 764| find_next(ctx, " \r\n\t>", 5, 1); # 765| PLIST_XML_ERR("Invalid special tag <[%.*s> encountered inside <%s> tag\n", (int)(ctx->pos - p), p, tag); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:770:17: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 768| } # 769| } else { # 770|-> p = ctx->pos; # 771| find_next(ctx, " \r\n\t>", 5, 1); # 772| PLIST_XML_ERR("Invalid special tag <!%.*s> encountered inside <%s> tag\n", (int)(ctx->pos - p), p, tag); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:779:13: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 777| break; # 778| } else { # 779|-> p = ctx->pos; # 780| find_next(ctx, " \r\n\t>", 5, 1); # 781| PLIST_XML_ERR("Invalid tag <%.*s> encountered inside <%s> tag\n", (int)(ctx->pos - p), p, tag); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:807:13: warning[deadcode.DeadStores]: Value stored to 'last' is never read # 805| if (q-p > 0) { # 806| if (last) { # 807|-> last = text_part_append(last, p, q-p, 0); # 808| } else if (parts) { # 809| last = text_part_init(parts, p, q-p, 0); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:809:13: warning[deadcode.DeadStores]: Value stored to 'last' is never read # 807| last = text_part_append(last, p, q-p, 0); # 808| } else if (parts) { # 809|-> last = text_part_init(parts, p, q-p, 0); # 810| } # 811| } Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:983:13: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 981| } # 982| if (*ctx->pos != '<') { # 983|-> p = ctx->pos; # 984| find_next(ctx, " \t\r\n", 4, 0); # 985| PLIST_XML_ERR("Expected: opening tag, found: %.*s\n", (int)(ctx->pos - p), p); Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:1052:17: warning[deadcode.DeadStores]: Value stored to 'p' is never read # 1050| } # 1051| } else { # 1052|-> p = ctx->pos; # 1053| find_next(ctx, " \r\n\t>", 5, 1); # 1054| PLIST_XML_ERR("Invalid or incomplete special tag <%.*s> encountered\n", (int)(ctx->pos - p), p); Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/src/xplist.c: scope_hint: In function 'node_from_xml' libplist-2.3.0-build/libplist-2.3.0/src/xplist.c:1071:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tag' where non-null expected <built-in>: note: argument 1 of '__builtin_strncpy' must be non-null # 1069| int taglen = ctx->pos - p; # 1070| tag = malloc(taglen + 1); # 1071|-> strncpy(tag, p, taglen); # 1072| tag[taglen] = '\0'; # 1073| if (*ctx->pos != '>') { Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/integer_set.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:51:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'filestats' # 49| if (argc != 3) # 50| { # 51|-> printf("Wrong input\n"); # 52| return 1; # 53| } Error: CPPCHECK_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:52: error[memleak]: Memory leak: filestats # 50| { # 51| printf("Wrong input\n"); # 52|-> return 1; # 53| } # 54| Error: CPPCHECK_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:63: error[memleak]: Memory leak: filestats # 61| { # 62| printf("File does not exists\n"); # 63|-> return 2; # 64| } # 65| printf("File %s is open\n", file_in); Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:66:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘filestats’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:28: included_from: Included from here. /usr/include/sys/stat.h:205:12: note: argument 2 of ‘stat’ must be non-null # 64| } # 65| printf("File %s is open\n", file_in); # 66|-> stat(file_in, filestats); # 67| size_in = filestats->st_size; # 68| plist_bin = (char *) malloc(sizeof(char) * (size_in + 1)); Error: COMPILER_WARNING (CWE-252): libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:69:5: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ # 69 | fread(plist_bin, sizeof(char), size_in, iplist); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 67| size_in = filestats->st_size; # 68| plist_bin = (char *) malloc(sizeof(char) * (size_in + 1)); # 69|-> fread(plist_bin, sizeof(char), size_in, iplist); # 70| fclose(iplist); # 71| Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:110:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(file_out, "wb")’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:80: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/test/plist_btest.c:23: included_from: Included from here. /usr/include/stdio.h:735:15: note: argument 4 of ‘fwrite’ must be non-null # 108| FILE *oplist = NULL; # 109| oplist = fopen(file_out, "wb"); # 110|-> fwrite(plist_bin2, size_out2, sizeof(char), oplist); # 111| fclose(oplist); # 112| } Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:51:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'filestats' # 49| if (argc != 3) # 50| { # 51|-> printf("Wrong input\n"); # 52| return 1; # 53| } Error: CPPCHECK_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:52: error[memleak]: Memory leak: filestats # 50| { # 51| printf("Wrong input\n"); # 52|-> return 1; # 53| } # 54| Error: CPPCHECK_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:63: error[memleak]: Memory leak: filestats # 61| { # 62| printf("File does not exists\n"); # 63|-> return 2; # 64| } # 65| printf("File %s is open\n", file_in); Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:66:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘filestats’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:28: included_from: Included from here. /usr/include/sys/stat.h:205:12: note: argument 2 of ‘stat’ must be non-null # 64| } # 65| printf("File %s is open\n", file_in); # 66|-> stat(file_in, filestats); # 67| size_in = filestats->st_size; # 68| plist_json = (char *) malloc(sizeof(char) * (size_in + 1)); Error: COMPILER_WARNING (CWE-252): libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:69:5: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ # 69 | fread(plist_json, sizeof(char), size_in, iplist); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 67| size_in = filestats->st_size; # 68| plist_json = (char *) malloc(sizeof(char) * (size_in + 1)); # 69|-> fread(plist_json, sizeof(char), size_in, iplist); # 70| fclose(iplist); # 71| plist_json[size_in] = 0; Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:110:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(file_out, "wb")’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:80: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/test/plist_jtest.c:23: included_from: Included from here. /usr/include/stdio.h:735:15: note: argument 4 of ‘fwrite’ must be non-null # 108| FILE *oplist = NULL; # 109| oplist = fopen(file_out, "wb"); # 110|-> fwrite(plist_json2, size_out2, sizeof(char), oplist); # 111| fclose(oplist); # 112| } Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_otest.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-252): libplist-2.3.0-build/libplist-2.3.0/test/plist_otest.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_otest.c:69:5: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ # 69 | fread(plist_ostep, sizeof(char), size_in, iplist); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 67| size_in = filestats.st_size; # 68| plist_ostep = (char *) malloc(sizeof(char) * (size_in + 1)); # 69|-> fread(plist_ostep, sizeof(char), size_in, iplist); # 70| fclose(iplist); # 71| plist_ostep[size_in] = 0; Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_otest.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_otest.c:110:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(file_out, "wb")’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:80: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/test/plist_otest.c:23: included_from: Included from here. /usr/include/stdio.h:735:15: note: argument 4 of ‘fwrite’ must be non-null # 108| FILE *oplist = NULL; # 109| oplist = fopen(file_out, "wb"); # 110|-> fwrite(plist_ostep2, size_out2, sizeof(char), oplist); # 111| fclose(oplist); # 112| } Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_test++.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:51:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'filestats' # 49| if (argc != 3) # 50| { # 51|-> printf("Wrong input\n"); # 52| return 1; # 53| } Error: CPPCHECK_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:52: error[memleak]: Memory leak: filestats # 50| { # 51| printf("Wrong input\n"); # 52|-> return 1; # 53| } # 54| Error: CPPCHECK_WARNING (CWE-401): libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:63: error[memleak]: Memory leak: filestats # 61| { # 62| printf("File does not exists\n"); # 63|-> return 2; # 64| } # 65| printf("File %s is open\n", file_in); Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:66:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘filestats’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:28: included_from: Included from here. /usr/include/sys/stat.h:205:12: note: argument 2 of ‘stat’ must be non-null # 64| } # 65| printf("File %s is open\n", file_in); # 66|-> stat(file_in, filestats); # 67| size_in = filestats->st_size; # 68| plist_xml = (char *) malloc(sizeof(char) * (size_in + 1)); Error: COMPILER_WARNING (CWE-252): libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c: scope_hint: In function ‘main’ libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:69:5: warning[-Wunused-result]: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ # 69 | fread(plist_xml, sizeof(char), size_in, iplist); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 67| size_in = filestats->st_size; # 68| plist_xml = (char *) malloc(sizeof(char) * (size_in + 1)); # 69|-> fread(plist_xml, sizeof(char), size_in, iplist); # 70| fclose(iplist); # 71| Error: GCC_ANALYZER_WARNING (CWE-688): libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:110:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen(file_out, "wb")’ where non-null expected libplist-2.3.0-build/libplist-2.3.0/include/plist/plist.h:80: included_from: Included from here. libplist-2.3.0-build/libplist-2.3.0/test/plist_test.c:23: included_from: Included from here. /usr/include/stdio.h:735:15: note: argument 4 of ‘fwrite’ must be non-null # 108| FILE *oplist = NULL; # 109| oplist = fopen(file_out, "wb"); # 110|-> fwrite(plist_xml2, size_out2, sizeof(char), oplist); # 111| fclose(oplist); # 112| } Error: CPPCHECK_WARNING: libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c: scope_hint: In function ‘parse_arguments’ libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:96:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 94| return NULL; # 95| } # 96|-> options->in_file = argv[i + 1]; # 97| i++; # 98| continue; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:107:31: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 105| return NULL; # 106| } # 107|-> options->out_file = argv[i + 1]; # 108| i++; # 109| continue; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:119:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 117| } # 118| if (!strncmp(argv[i+1], "bin", 3)) { # 119|-> options->out_fmt = PLIST_FORMAT_BINARY; # 120| } else if (!strncmp(argv[i+1], "xml", 3)) { # 121| options->out_fmt = PLIST_FORMAT_XML; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:121:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 119| options->out_fmt = PLIST_FORMAT_BINARY; # 120| } else if (!strncmp(argv[i+1], "xml", 3)) { # 121|-> options->out_fmt = PLIST_FORMAT_XML; # 122| } else if (!strncmp(argv[i+1], "json", 4)) { # 123| options->out_fmt = PLIST_FORMAT_JSON; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:123:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 121| options->out_fmt = PLIST_FORMAT_XML; # 122| } else if (!strncmp(argv[i+1], "json", 4)) { # 123|-> options->out_fmt = PLIST_FORMAT_JSON; # 124| } else if (!strncmp(argv[i+1], "openstep", 8) || !strncmp(argv[i+1], "ostep", 5)) { # 125| options->out_fmt = PLIST_FORMAT_OSTEP; Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:125:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 123| options->out_fmt = PLIST_FORMAT_JSON; # 124| } else if (!strncmp(argv[i+1], "openstep", 8) || !strncmp(argv[i+1], "ostep", 5)) { # 125|-> options->out_fmt = PLIST_FORMAT_OSTEP; # 126| } else { # 127| fprintf(stderr, "ERROR: Unsupported output format\n"); Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:136:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 134| else if (!strcmp(argv[i], "--compact") || !strcmp(argv[i], "-c")) # 135| { # 136|-> options->flags |= OPT_COMPACT; # 137| } # 138| else if (!strcmp(argv[i], "--sort") || !strcmp(argv[i], "-s")) Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:140:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 138| else if (!strcmp(argv[i], "--sort") || !strcmp(argv[i], "-s")) # 139| { # 140|-> options->flags |= OPT_SORT; # 141| } # 142| else if (!strcmp(argv[i], "--print") || !strcmp(argv[i], "-p")) Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:149:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 147| return NULL; # 148| } # 149|-> options->in_file = argv[i + 1]; # 150| options->out_fmt = PLIST_FORMAT_PRINT; # 151| char *env_fmt = getenv("PLIST_OUTPUT_FORMAT"); Error: GCC_ANALYZER_WARNING (CWE-476): libplist-2.3.0-build/libplist-2.3.0/tools/plistutil.c:164:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘options’ # 162| else if (!strcmp(argv[i], "--debug") || !strcmp(argv[i], "-d")) # 163| { # 164|-> options->flags |= OPT_DEBUG; # 165| } # 166| else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h"))