Error: GCC_ANALYZER_WARNING (CWE-476): [#def1] ModemManager-1.24.2/cli/mmcli-common.c:184:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘modem_physdev’ ModemManager-1.24.2/cli/mmcli-common.c:1779:1: enter_function: entry to ‘mmcli_get_cbm_sync’ ModemManager-1.24.2/cli/mmcli-common.c:1790:5: call_function: calling ‘get_object_lookup_info’ from ‘mmcli_get_cbm_sync’ # 182| if (g_str_has_prefix (str, "/")) { # 183| g_debug ("Assuming '%s' is the %s physdev path", str, object_type); # 184|-> *modem_physdev = g_strdup (str); # 185| return; # 186| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def2] ModemManager-1.24.2/cli/mmcli-common.c:997:13: warning[-Wanalyzer-null-argument]: use of NULL ‘sim_path’ where non-null expected ModemManager-1.24.2/cli/mmcli-common.c:946:1: enter_function: entry to ‘mmcli_get_sim_sync’ ModemManager-1.24.2/cli/mmcli-common.c:959:5: call_function: calling ‘get_object_lookup_info’ from ‘mmcli_get_sim_sync’ ModemManager-1.24.2/cli/mmcli-common.c:959:5: return_function: returning to ‘mmcli_get_sim_sync’ from ‘get_object_lookup_info’ ModemManager-1.24.2/cli/mmcli-common.c:961:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-common.c:963:15: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-common.c:963:15: call_function: calling ‘mmcli_get_manager_sync’ from ‘mmcli_get_sim_sync’ ModemManager-1.24.2/cli/mmcli-common.c:963:15: return_function: returning to ‘mmcli_get_sim_sync’ from ‘mmcli_get_manager_sync’ ModemManager-1.24.2/cli/mmcli-common.c:965:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-common.c:965:8: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-common.c:971:22: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-common.c:972:29: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-common.c:982:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-common.c:983:13: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-common.c:983:13: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-common.c:984:24: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-common.c:997:13: release_memory: ‘sim_path’ is NULL ModemManager-1.24.2/cli/mmcli-common.c:997:13: danger: argument 1 (‘sim_path’) NULL where non-null expected # 995| } # 996| # 997|-> if (g_str_equal (sim_path, mm_modem_get_sim_path (modem))) { # 998| found = mm_modem_get_sim_sync (modem, NULL, &error); # 999| if (error) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def3] ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:325:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘error’ ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:270:1: enter_function: entry to ‘get_modem_ready’ ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:281:5: call_function: calling ‘ensure_modem_3gpp_profile_manager’ from ‘get_modem_ready’ ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:281:5: return_function: returning to ‘get_modem_ready’ from ‘ensure_modem_3gpp_profile_manager’ ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:283:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:287:9: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:287:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:297:9: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:297:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:317:9: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:317:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:319:34: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:319:34: release_memory: ‘error’ is NULL ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:323:19: call_function: calling ‘delete_build_input’ from ‘get_modem_ready’ ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:323:19: return_function: returning to ‘get_modem_ready’ from ‘delete_build_input’ ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:324:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:325:70: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:325:70: release_memory: ‘error’ is NULL ModemManager-1.24.2/cli/mmcli-modem-3gpp-profile-manager.c:325:13: danger: dereference of NULL ‘error’ # 323| profile = delete_build_input (delete_str, &error); # 324| if (!profile) { # 325|-> g_printerr ("Error parsing profile string: '%s'\n", error->message); # 326| exit (EXIT_FAILURE); # 327| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def4] ModemManager-1.24.2/cli/mmcli-output.c:1536:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘current_path’ ModemManager-1.24.2/cli/mmcli-output.c:1493:28: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)... ModemManager-1.24.2/cli/mmcli-output.c:1494:21: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1496:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-output.c:1526:13: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1529:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-output.c:1533:17: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1536:13: danger: dereference of NULL ‘current_path + (long unsigned int)cur_dlen * 8’ # 1534| escaped = json_strescape (single->value); # 1535| # 1536|-> g_print ("\"%s\":\"%s\"", current_path[cur_dlen], escaped ? escaped : "--"); # 1537| g_free (escaped); # 1538| } else if (item_l->type == VALUE_TYPE_MULTIPLE) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def5] ModemManager-1.24.2/cli/mmcli-output.c:1544:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘current_path’ ModemManager-1.24.2/cli/mmcli-output.c:1493:28: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)... ModemManager-1.24.2/cli/mmcli-output.c:1494:21: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1496:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-output.c:1526:13: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1529:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/cli/mmcli-output.c:1538:19: branch_false: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1538:19: branch_true: following ‘true’ branch... ModemManager-1.24.2/cli/mmcli-output.c:1542:17: branch_true: ...to here ModemManager-1.24.2/cli/mmcli-output.c:1544:13: danger: dereference of NULL ‘current_path + (long unsigned int)cur_dlen * 8’ # 1542| n = multiple->values ? g_strv_length (multiple->values) : 0; # 1543| # 1544|-> g_print ("\"%s\":[", current_path[cur_dlen]); # 1545| for (i = 0; i < n; i++) { # 1546| if (multiple->is_object) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def6] ModemManager-1.24.2/libmm-glib/mm-location-gps-nmea.c:84:9: warning[-Wanalyzer-null-argument]: use of NULL ‘trace’ where non-null expected ModemManager-1.24.2/libmm-glib/mm-location-gps-nmea.c:131:1: enter_function: entry to ‘mm_location_gps_nmea_add_trace’ ModemManager-1.24.2/libmm-glib/mm-location-gps-nmea.c:134:12: call_function: calling ‘location_gps_nmea_take_trace’ from ‘mm_location_gps_nmea_add_trace’ # 82| gchar *trace_type; # 83| # 84|-> i = strchr (trace, ','); # 85| if (!i || i == trace) { # 86| g_free (trace); Error: CPPCHECK_WARNING (CWE-476): [#def7] ModemManager-1.24.2/libqcdm/src/commands.c:1744: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmd # 1742| # 1743| cmd = calloc (1, cmdbufsize); # 1744|-> cmd->code = DIAG_CMD_LOG_CONFIG; # 1745| cmd->op = htole32 (op); # 1746| cmd->equipid = htole32 (equip_id); Error: GCC_ANALYZER_WARNING (CWE-476): [#def8] ModemManager-1.24.2/libqcdm/src/commands.c:1744:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cmd’ ModemManager-1.24.2/libqcdm/src/commands.c:1725:5: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... ModemManager-1.24.2/libqcdm/src/commands.c:1726:5: branch_false: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1726:5: branch_false: following ‘false’ branch... ModemManager-1.24.2/libqcdm/src/commands.c:1729:8: branch_false: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1741:5: branch_false: following ‘false’ branch (when ‘cmdsize <= len’)... ModemManager-1.24.2/libqcdm/src/commands.c:1743:11: branch_false: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1743:11: acquire_memory: this call could return NULL ModemManager-1.24.2/libqcdm/src/commands.c:1744:5: danger: ‘cmd’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) # 1742| # 1743| cmd = calloc (1, cmdbufsize); # 1744|-> cmd->code = DIAG_CMD_LOG_CONFIG; # 1745| cmd->op = htole32 (op); # 1746| cmd->equipid = htole32 (equip_id); Error: CPPCHECK_WARNING (CWE-476): [#def9] ModemManager-1.24.2/libqcdm/src/commands.c:1745: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmd # 1743| cmd = calloc (1, cmdbufsize); # 1744| cmd->code = DIAG_CMD_LOG_CONFIG; # 1745|-> cmd->op = htole32 (op); # 1746| cmd->equipid = htole32 (equip_id); # 1747| Error: CPPCHECK_WARNING (CWE-476): [#def10] ModemManager-1.24.2/libqcdm/src/commands.c:1746: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmd # 1744| cmd->code = DIAG_CMD_LOG_CONFIG; # 1745| cmd->op = htole32 (op); # 1746|-> cmd->equipid = htole32 (equip_id); # 1747| # 1748| if (items) { Error: CPPCHECK_WARNING (CWE-476): [#def11] ModemManager-1.24.2/libqcdm/src/commands.c:1752: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmd # 1750| for (i = 0; i < items_len; i++) { # 1751| log_code = items[i] & 0x0FFF; /* Strip off equip ID */ # 1752|-> cmd->mask[log_code / 8] |= 1 << log_code % 8; # 1753| } # 1754| cmd->num_items = htole32 (highest); Error: CPPCHECK_WARNING (CWE-476): [#def12] ModemManager-1.24.2/libqcdm/src/commands.c:1754: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: cmd # 1752| cmd->mask[log_code / 8] |= 1 << log_code % 8; # 1753| } # 1754|-> cmd->num_items = htole32 (highest); # 1755| } # 1756| Error: GCC_ANALYZER_WARNING (CWE-476): [#def13] ModemManager-1.24.2/libqcdm/src/commands.c:1882:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘items’ ModemManager-1.24.2/libqcdm/src/commands.c:1867:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/libqcdm/src/commands.c:1867:8: branch_true: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1878:12: branch_true: following ‘true’ branch (when ‘num_result_items != 0’)... ModemManager-1.24.2/libqcdm/src/commands.c:1879:21: branch_true: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1879:21: acquire_memory: this call could return NULL ModemManager-1.24.2/libqcdm/src/commands.c:1880:25: branch_true: following ‘true’ branch... ModemManager-1.24.2/libqcdm/src/commands.c:1881:21: branch_true: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1881:20: branch_true: following ‘true’ branch... ModemManager-1.24.2/libqcdm/src/commands.c:1882:38: branch_true: ...to here ModemManager-1.24.2/libqcdm/src/commands.c:1882:21: danger: ‘items + (long unsigned int)count * 2’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4) # 1880| for (i = 0; i < num_items; i++) { # 1881| if (LOG_CODE_SET (rsp->u.get_set_items.mask, i)) # 1882|-> items[count++] = (equipid << 12) | (i & 0x0FFF); # 1883| } # 1884| Error: GCC_ANALYZER_WARNING (CWE-688): [#def14] ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:132:10: warning[-Wanalyzer-null-argument]: use of NULL ‘left’ where non-null expected ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:401:1: enter_function: entry to ‘mm_kernel_device_generic_rules_load’ ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:413:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:413:8: branch_false: ...to here ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:420:26: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)... ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:421:58: branch_true: ...to here ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:421:14: call_function: calling ‘load_rules_from_file’ from ‘mm_kernel_device_generic_rules_load’ # 130| return FALSE; # 131| # 132|-> if (!g_str_equal (operator, "=")) { # 133| inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, # 134| "Invalid rule result operator: '%s'", item); Error: GCC_ANALYZER_WARNING (CWE-688): [#def15] ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:138:9: warning[-Wanalyzer-null-argument]: use of NULL ‘left’ where non-null expected ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:401:1: enter_function: entry to ‘mm_kernel_device_generic_rules_load’ ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:413:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:413:8: branch_false: ...to here ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:420:26: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)... ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:421:58: branch_true: ...to here ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:421:14: call_function: calling ‘load_rules_from_file’ from ‘mm_kernel_device_generic_rules_load’ # 136| } # 137| # 138|-> if (g_str_equal (left, "LABEL")) { # 139| rule_result->type = MM_UDEV_RULE_RESULT_TYPE_LABEL; # 140| rule_result->content.tag = right; Error: GCC_ANALYZER_WARNING (CWE-688): [#def16] ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:189:9: warning[-Wanalyzer-null-argument]: use of NULL ‘left’ where non-null expected ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:401:1: enter_function: entry to ‘mm_kernel_device_generic_rules_load’ ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:413:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:413:8: branch_false: ...to here ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:420:26: branch_true: following ‘true’ branch (when ‘l’ is non-NULL)... ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:421:58: branch_true: ...to here ModemManager-1.24.2/src/kerneldevice/mm-kernel-device-generic-rules.c:421:14: call_function: calling ‘load_rules_from_file’ from ‘mm_kernel_device_generic_rules_load’ # 187| return FALSE; # 188| # 189|-> if (g_str_equal (operator, "==")) # 190| rule_match->type = MM_UDEV_RULE_MATCH_TYPE_EQUAL; # 191| else if (g_str_equal (operator, "!=")) Error: GCC_ANALYZER_WARNING (CWE-457): [#def17] ModemManager-1.24.2/src/mm-bearer-mbim.c:1739:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘nw_error’ ModemManager-1.24.2/src/mm-bearer-mbim.c:1675:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1678:14: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1681:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1682:9: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1681:9: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1683:9: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1681:9: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1711:9: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1711:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1719:9: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1719:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1731:9: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1731:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-bearer-mbim.c:1739:16: branch_false: ...to here ModemManager-1.24.2/src/mm-bearer-mbim.c:1739:16: danger: use of uninitialized value ‘nw_error’ here # 1737| } # 1738| # 1739|-> nw_error = mm_broadband_modem_mbim_normalize_nw_error (ctx->modem, nw_error); # 1740| if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) && parsed_result && nw_error != 0) { # 1741| g_assert (!inner_error); Error: GCC_ANALYZER_WARNING (CWE-476): [#def18] ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3378:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘array_used_flags’ ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3393:1: enter_function: entry to ‘nas_network_scan_ready’ ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3401:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3404:17: branch_false: ...to here ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3404:15: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3409:17: branch_false: ...to here ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3411:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3412:21: branch_true: ...to here ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3418:16: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3421:13: branch_false: ...to here ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3421:25: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3425:33: branch_true: ...to here ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3427:24: call_function: calling ‘get_3gpp_network_info’ from ‘nas_network_scan_ready’ ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3427:24: return_function: returning to ‘nas_network_scan_ready’ from ‘get_3gpp_network_info’ ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3428:20: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3429:41: branch_true: ...to here ModemManager-1.24.2/src/mm-broadband-modem-qmi.c:3429:41: call_function: calling ‘get_3gpp_access_technology’ from ‘nas_network_scan_ready’ # 3376| QmiMessageNasNetworkScanOutputRadioAccessTechnologyElement *element; # 3377| # 3378|-> if (array_used_flags[i]) # 3379| continue; # 3380| Error: COMPILER_WARNING (CWE-704): [#def19] ModemManager-1.24.2/src/mm-broadband-modem.c: scope_hint: In function ‘decode_ussd_response’ ModemManager-1.24.2/src/mm-broadband-modem.c:6617:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 6617 | p = strchr (reply, ','); # | ^ # 6615| # 6616| /* Look for the first ',' */ # 6617|-> p = strchr (reply, ','); # 6618| if (!p) { # 6619| g_set_error (error, Error: COMPILER_WARNING (CWE-704): [#def20] ModemManager-1.24.2/src/mm-broadband-modem.c:6617:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 6615| # 6616| /* Look for the first ',' */ # 6617|-> p = strchr (reply, ','); # 6618| if (!p) { # 6619| g_set_error (error, Error: GCC_ANALYZER_WARNING (CWE-476): [#def21] ModemManager-1.24.2/src/mm-charsets.c:694:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘settings’ ModemManager-1.24.2/src/mm-charsets.c:722:1: enter_function: entry to ‘mm_modem_charset_bytearray_from_utf8’ ModemManager-1.24.2/src/mm-charsets.c:731:16: call_function: calling ‘lookup_charset_settings’ from ‘mm_modem_charset_bytearray_from_utf8’ ModemManager-1.24.2/src/mm-charsets.c:731:16: return_function: returning to ‘mm_modem_charset_bytearray_from_utf8’ from ‘lookup_charset_settings’ ModemManager-1.24.2/src/mm-charsets.c:733:8: branch_false: following ‘false’ branch (when ‘charset != 0’)... ModemManager-1.24.2/src/mm-charsets.c:739:5: branch_false: ...to here ModemManager-1.24.2/src/mm-charsets.c:750:23: call_function: calling ‘charset_iconv_from_utf8’ from ‘mm_modem_charset_bytearray_from_utf8’ # 692| # 693| encoded = (guint8 *) g_convert (utf8, -1, # 694|-> settings->iconv_name, "UTF-8", # 695| NULL, &bytes_written, &inner_error); # 696| if (encoded) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def22] ModemManager-1.24.2/src/mm-charsets.c:819:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘settings’ ModemManager-1.24.2/src/mm-charsets.c:841:1: enter_function: entry to ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:849:8: branch_false: following ‘false’ branch (when ‘charset != 0’)... ModemManager-1.24.2/src/mm-charsets.c:855:16: branch_false: ...to here ModemManager-1.24.2/src/mm-charsets.c:855:16: call_function: calling ‘lookup_charset_settings’ from ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:855:16: return_function: returning to ‘mm_modem_charset_bytearray_to_utf8’ from ‘lookup_charset_settings’ ModemManager-1.24.2/src/mm-charsets.c:871:20: call_function: calling ‘charset_iconv_to_utf8’ from ‘mm_modem_charset_bytearray_to_utf8’ # 817| utf8 = g_convert ((const gchar *) data, len, # 818| "UTF-8", # 819|-> settings->iconv_name, # 820| NULL, NULL, &inner_error); # 821| if (utf8) Error: GCC_ANALYZER_WARNING (CWE-476): [#def23] ModemManager-1.24.2/src/mm-charsets.c:883:73: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ModemManager-1.24.2/src/mm-charsets.c:841:1: enter_function: entry to ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:849:8: branch_false: following ‘false’ branch (when ‘charset != 0’)... ModemManager-1.24.2/src/mm-charsets.c:855:16: branch_false: ...to here ModemManager-1.24.2/src/mm-charsets.c:855:16: call_function: calling ‘lookup_charset_settings’ from ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:855:16: return_function: returning to ‘mm_modem_charset_bytearray_to_utf8’ from ‘lookup_charset_settings’ ModemManager-1.24.2/src/mm-charsets.c:882:8: branch_true: following ‘true’ branch (when ‘utf8’ is NULL)... ModemManager-1.24.2/src/mm-charsets.c:883:73: branch_true: ...to here ModemManager-1.24.2/src/mm-charsets.c:883:73: danger: dereference of NULL ‘lookup_charset_settings(charset)’ # 881| # 882| if (!utf8) { # 883|-> g_prefix_error (error, "Invalid conversion from %s to UTF-8: ", settings->gsm_name); # 884| return NULL; # 885| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def24] ModemManager-1.24.2/src/mm-charsets.c:889:67: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ModemManager-1.24.2/src/mm-charsets.c:841:1: enter_function: entry to ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:849:8: branch_false: following ‘false’ branch (when ‘charset != 0’)... ModemManager-1.24.2/src/mm-charsets.c:855:16: branch_false: ...to here ModemManager-1.24.2/src/mm-charsets.c:855:16: call_function: calling ‘lookup_charset_settings’ from ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:855:16: return_function: returning to ‘mm_modem_charset_bytearray_to_utf8’ from ‘lookup_charset_settings’ ModemManager-1.24.2/src/mm-charsets.c:859:30: call_function: calling ‘charset_gsm_unpacked_to_utf8’ from ‘mm_modem_charset_bytearray_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:859:30: return_function: returning to ‘mm_modem_charset_bytearray_to_utf8’ from ‘charset_gsm_unpacked_to_utf8’ ModemManager-1.24.2/src/mm-charsets.c:882:8: branch_false: following ‘false’ branch (when ‘utf8’ is non-NULL)... ModemManager-1.24.2/src/mm-charsets.c:887:10: branch_false: ...to here ModemManager-1.24.2/src/mm-charsets.c:887:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-charsets.c:889:67: branch_true: ...to here ModemManager-1.24.2/src/mm-charsets.c:889:67: danger: dereference of NULL ‘lookup_charset_settings(charset)’ # 887| if (!g_utf8_validate (utf8, -1, NULL)) { # 888| g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, # 889|-> "Invalid conversion from %s: invalid UTF-8", settings->gsm_name); # 890| return NULL; # 891| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def25] ModemManager-1.24.2/src/mm-iface-modem-firmware.c:506:86: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ModemManager-1.24.2/src/mm-iface-modem-firmware.c:476:1: enter_function: entry to ‘load_update_settings_ready’ ModemManager-1.24.2/src/mm-iface-modem-firmware.c:489:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-iface-modem-firmware.c:496:10: branch_false: ...to here ModemManager-1.24.2/src/mm-iface-modem-firmware.c:496:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-iface-modem-firmware.c:497:9: branch_true: ...to here ModemManager-1.24.2/src/mm-iface-modem-firmware.c:498:15: call_function: calling ‘mm_iface_firmware_build_generic_device_ids’ from ‘load_update_settings_ready’ ModemManager-1.24.2/src/mm-iface-modem-firmware.c:498:15: return_function: returning to ‘load_update_settings_ready’ from ‘mm_iface_firmware_build_generic_device_ids’ ModemManager-1.24.2/src/mm-iface-modem-firmware.c:499:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-iface-modem-firmware.c:506:86: branch_false: ...to here ModemManager-1.24.2/src/mm-iface-modem-firmware.c:506:86: danger: dereference of NULL ‘mm_iface_firmware_build_generic_device_ids(self, & error)’ # 504| } # 505| # 506|-> mm_firmware_update_settings_set_device_ids (update_settings, (const gchar **)ids->pdata); # 507| } # 508| Error: GCC_ANALYZER_WARNING (CWE-476): [#def26] ModemManager-1.24.2/src/mm-modem-helpers.c:3005:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘interval_separator’ ModemManager-1.24.2/src/mm-modem-helpers.c:2945:1: enter_function: entry to ‘mm_3gpp_parse_cscb_response’ ModemManager-1.24.2/src/mm-modem-helpers.c:2957:8: branch_false: following ‘false’ branch (when ‘len != 0’)... ModemManager-1.24.2/src/mm-modem-helpers.c:2965:9: branch_false: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:2972:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-modem-helpers.c:2974:5: branch_true: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:2975:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-modem-helpers.c:2978:10: branch_false: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:2978:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-modem-helpers.c:2983:11: branch_false: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:2984:8: branch_false: following ‘false’ branch (when the strings are equal)... ModemManager-1.24.2/src/mm-modem-helpers.c:2990:11: branch_false: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:2992:17: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-modem-helpers.c:2995:9: branch_true: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:2997:12: branch_true: following ‘true’ branch (when ‘interval_separator’ is non-NULL)... ModemManager-1.24.2/src/mm-modem-helpers.c:3003:21: call_function: inlined call to ‘g_strdup_inline’ from ‘mm_3gpp_parse_cscb_response’ ModemManager-1.24.2/src/mm-modem-helpers.c:3005:13: danger: dereference of NULL ‘interval_separator’ # 3003| start = g_strdup (intervals[i]); # 3004| interval_separator = strstr (start, "-"); # 3005|-> *(interval_separator++) = '\0'; # 3006| end = interval_separator; # 3007| Error: COMPILER_WARNING (CWE-704): [#def27] ModemManager-1.24.2/src/mm-modem-helpers.c: scope_hint: In function ‘mm_3gpp_parse_cscs_test_response’ ModemManager-1.24.2/src/mm-modem-helpers.c:3261:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 3261 | p = strchr (reply, '('); # | ^ # 3259| * but some devices (some Blackberries) don't include the (). # 3260| */ # 3261|-> p = strchr (reply, '('); # 3262| if (p) # 3263| p++; Error: COMPILER_WARNING (CWE-704): [#def28] ModemManager-1.24.2/src/mm-modem-helpers.c:3261:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 3259| * but some devices (some Blackberries) don't include the (). # 3260| */ # 3261|-> p = strchr (reply, '('); # 3262| if (p) # 3263| p++; Error: COMPILER_WARNING (CWE-704): [#def29] ModemManager-1.24.2/src/mm-modem-helpers.c:3265:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 3265 | p = strchr (reply, '"'); # | ^ # 3263| p++; # 3264| else { # 3265|-> p = strchr (reply, '"'); # 3266| if (!p) # 3267| return FALSE; Error: COMPILER_WARNING (CWE-704): [#def30] ModemManager-1.24.2/src/mm-modem-helpers.c:3265:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 3263| p++; # 3264| else { # 3265|-> p = strchr (reply, '"'); # 3266| if (!p) # 3267| return FALSE; Error: GCC_ANALYZER_WARNING (CWE-688): [#def31] ModemManager-1.24.2/src/mm-modem-helpers.c:3828:33: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected ModemManager-1.24.2/src/mm-modem-helpers.c:3801:1: enter_function: entry to ‘mm_3gpp_parse_cgev_indication_pdp’ ModemManager-1.24.2/src/mm-modem-helpers.c:3815:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-modem-helpers.c:3820:9: branch_true: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:3825:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/mm-modem-helpers.c:3827:11: branch_true: ...to here ModemManager-1.24.2/src/mm-modem-helpers.c:3827:11: call_function: calling ‘mm_strip_tag’ from ‘mm_3gpp_parse_cgev_indication_pdp’ ModemManager-1.24.2/src/mm-modem-helpers.c:3827:11: return_function: returning to ‘mm_3gpp_parse_cgev_indication_pdp’ from ‘mm_strip_tag’ ModemManager-1.24.2/src/mm-modem-helpers.c:3828:33: danger: argument 1 (‘mm_strip_tag(str, "+CGEV:")’) NULL where non-null expected # 3826| # 3827| str = mm_strip_tag (str, "+CGEV:"); # 3828|-> g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); # 3829| if (inner_error) { # 3830| g_propagate_error (error, inner_error); Error: GCC_ANALYZER_WARNING (CWE-688): [#def32] ModemManager-1.24.2/src/mm-modem-helpers.c:3901:33: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected ModemManager-1.24.2/src/mm-modem-helpers.c:3880:1: enter_function: entry to ‘mm_3gpp_parse_cgev_indication_primary’ ModemManager-1.24.2/src/mm-modem-helpers.c:3900:11: call_function: calling ‘mm_strip_tag’ from ‘mm_3gpp_parse_cgev_indication_primary’ ModemManager-1.24.2/src/mm-modem-helpers.c:3900:11: return_function: returning to ‘mm_3gpp_parse_cgev_indication_primary’ from ‘mm_strip_tag’ ModemManager-1.24.2/src/mm-modem-helpers.c:3901:33: danger: argument 1 (‘mm_strip_tag(str, "+CGEV:")’) NULL where non-null expected # 3899| # 3900| str = mm_strip_tag (str, "+CGEV:"); # 3901|-> g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); # 3902| if (inner_error) # 3903| goto out; Error: GCC_ANALYZER_WARNING (CWE-688): [#def33] ModemManager-1.24.2/src/mm-modem-helpers.c:3958:33: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected ModemManager-1.24.2/src/mm-modem-helpers.c:3933:1: enter_function: entry to ‘mm_3gpp_parse_cgev_indication_secondary’ ModemManager-1.24.2/src/mm-modem-helpers.c:3957:11: call_function: calling ‘mm_strip_tag’ from ‘mm_3gpp_parse_cgev_indication_secondary’ ModemManager-1.24.2/src/mm-modem-helpers.c:3957:11: return_function: returning to ‘mm_3gpp_parse_cgev_indication_secondary’ from ‘mm_strip_tag’ ModemManager-1.24.2/src/mm-modem-helpers.c:3958:33: danger: argument 1 (‘mm_strip_tag(str, "+CGEV:")’) NULL where non-null expected # 3956| # 3957| str = mm_strip_tag (str, "+CGEV:"); # 3958|-> g_regex_match_full (r, str, strlen (str), 0, 0, &match_info, &inner_error); # 3959| if (inner_error) # 3960| goto out; Error: GCC_ANALYZER_WARNING (CWE-476): [#def34] ModemManager-1.24.2/src/mm-shared-qmi.c:3058:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘current_config’ ModemManager-1.24.2/src/mm-shared-qmi.c:3029:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-shared-qmi.c:3034:9: branch_false: ...to here ModemManager-1.24.2/src/mm-shared-qmi.c:3034:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-shared-qmi.c:3041:10: branch_false: ...to here ModemManager-1.24.2/src/mm-shared-qmi.c:3041:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-shared-qmi.c:3041:8: branch_false: ...to here ModemManager-1.24.2/src/mm-shared-qmi.c:3047:17: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-shared-qmi.c:3054:8: branch_false: ...to here ModemManager-1.24.2/src/mm-shared-qmi.c:3054:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/mm-shared-qmi.c:3058:9: branch_false: ...to here ModemManager-1.24.2/src/mm-shared-qmi.c:3058:9: danger: dereference of NULL ‘current_config’ # 3056| # 3057| /* Ignore if already set */ # 3058|-> if (current_config->description) # 3059| return; # 3060| Error: GCC_ANALYZER_WARNING (CWE-476): [#def35] ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:594:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘error’ ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:580:1: enter_function: entry to ‘disconnect_connection_status_ready’ ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:586:31: release_memory: ‘error’ is NULL ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:590:14: call_function: calling ‘load_connection_status_finish’ from ‘disconnect_connection_status_ready’ ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:590:14: return_function: returning to ‘disconnect_connection_status_ready’ from ‘load_connection_status_finish’ ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:594:9: release_memory: ‘error’ is NULL ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-bearer-cinterion.c:594:9: danger: dereference of NULL ‘error’ # 592| case MM_BEARER_CONNECTION_STATUS_UNKNOWN: # 593| /* Assume disconnected */ # 594|-> mm_obj_dbg (self, "couldn't get CID %u status, assume disconnected: %s", ctx->cid, error->message); # 595| g_clear_error (&error); # 596| break; Error: GCC_ANALYZER_WARNING (CWE-476): [#def36] ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-modem-cinterion.c:3114:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘error’ ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-modem-cinterion.c:3106:27: release_memory: ‘error’ is NULL ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-modem-cinterion.c:3113:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-modem-cinterion.c:3114:9: branch_true: ...to here ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-modem-cinterion.c:3114:9: release_memory: ‘error’ is NULL ModemManager-1.24.2/src/plugins/cinterion/mm-broadband-modem-cinterion.c:3114:9: danger: dereference of NULL ‘error’ # 3112| response = g_match_info_fetch (match_info, 1); # 3113| if (!response || !mm_cinterion_get_available_from_simlocal (response, &available, &error)) { # 3114|-> mm_obj_warn (self, "Could not parse list of available SIMs: %s", error->message); # 3115| return; # 3116| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def37] ModemManager-1.24.2/src/plugins/huawei/mm-broadband-modem-huawei.c:1475:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘current’ ModemManager-1.24.2/src/plugins/huawei/mm-broadband-modem-huawei.c:1464:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/huawei/mm-broadband-modem-huawei.c:1469:9: branch_false: ...to here ModemManager-1.24.2/src/plugins/huawei/mm-broadband-modem-huawei.c:1469:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/huawei/mm-broadband-modem-huawei.c:1474:15: branch_false: ...to here ModemManager-1.24.2/src/plugins/huawei/mm-broadband-modem-huawei.c:1475:24: danger: dereference of NULL ‘current’ # 1473| # 1474| out = g_new (MMModemModeCombination, 1); # 1475|-> out->allowed = current->allowed; # 1476| out->preferred = current->preferred; # 1477| g_task_return_pointer (task, out, g_free); Error: GCC_ANALYZER_WARNING (CWE-476): [#def38] ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:175:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘interval_separator’ ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:122:1: enter_function: entry to ‘load_supported_modes_finish’ ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:134:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:142:9: branch_false: ...to here ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:144:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:146:5: branch_true: ...to here ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:147:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:150:15: branch_true: ...to here ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:151:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:152:21: branch_true: ...to here ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:155:8: branch_false: following ‘false’ branch (when ‘split’ is non-NULL)... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:155:8: branch_false: ...to here ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:163:17: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:166:9: branch_true: ...to here ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:168:12: branch_true: following ‘true’ branch (when ‘interval_separator’ is non-NULL)... ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:173:21: call_function: inlined call to ‘g_strdup_inline’ from ‘load_supported_modes_finish’ ModemManager-1.24.2/src/plugins/icera/mm-broadband-modem-icera.c:175:13: danger: dereference of NULL ‘interval_separator’ # 173| first = g_strdup (split[i]); # 174| interval_separator = strstr (first, "-"); # 175|-> *(interval_separator++) = '\0'; # 176| last = interval_separator; # 177| Error: COMPILER_WARNING (CWE-704): [#def39] ModemManager-1.24.2/src/plugins/novatel/mm-broadband-modem-novatel.c: scope_hint: In function ‘get_one_quality’ ModemManager-1.24.2/src/plugins/novatel/mm-broadband-modem-novatel.c:729:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 729 | p = strstr (reply, tag); # | ^ # 727| gboolean success = FALSE; # 728| # 729|-> p = strstr (reply, tag); # 730| if (!p) # 731| return -1; Error: COMPILER_WARNING (CWE-704): [#def40] ModemManager-1.24.2/src/plugins/novatel/mm-broadband-modem-novatel.c:729:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 727| gboolean success = FALSE; # 728| # 729|-> p = strstr (reply, tag); # 730| if (!p) # 731| return -1; Error: COMPILER_WARNING (CWE-704): [#def41] ModemManager-1.24.2/src/plugins/sierra/mm-broadband-modem-sierra.c: scope_hint: In function ‘get_roam_value’ ModemManager-1.24.2/src/plugins/sierra/mm-broadband-modem-sierra.c:153:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 153 | p = strstr (reply, tag); # | ^ # 151| guint32 ind = 0; # 152| # 153|-> p = strstr (reply, tag); # 154| if (!p) # 155| return FALSE; Error: COMPILER_WARNING (CWE-704): [#def42] ModemManager-1.24.2/src/plugins/sierra/mm-broadband-modem-sierra.c:153:7: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 151| guint32 ind = 0; # 152| # 153|-> p = strstr (reply, tag); # 154| if (!p) # 155| return FALSE; Error: GCC_ANALYZER_WARNING (CWE-476): [#def43] ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1625:1: enter_function: entry to ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1643:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1651:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1653:38: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1654:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1657:9: branch_false: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1657:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1661:16: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1664:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1665:13: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1666:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1658:27: call_function: inlined call to ‘g_autoptr_cleanup_generic_gfree’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1672:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: branch_false: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1679:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1679:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1680:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1680:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:10: danger: dereference of NULL ‘parse_bands_from_string(bands2g_str, "2G", log_object)’ # 1680| bands4g = parse_bands_from_string (bands4g_str, "4G", log_object); # 1681| # 1682|-> if (!bands2g->len && !bands3g->len && !bands4g->len) { # 1683| inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, # 1684| "no supported frequencies reported: %s", response); Error: GCC_ANALYZER_WARNING (CWE-476): [#def44] ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1625:1: enter_function: entry to ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1643:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1651:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1653:38: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1654:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1657:9: branch_false: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1657:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1661:16: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1664:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1665:13: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1666:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1658:27: call_function: inlined call to ‘g_autoptr_cleanup_generic_gfree’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1672:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: branch_false: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1679:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1679:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1680:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1680:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:27: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:27: danger: dereference of NULL ‘parse_bands_from_string(bands3g_str, "3G", log_object)’ # 1680| bands4g = parse_bands_from_string (bands4g_str, "4G", log_object); # 1681| # 1682|-> if (!bands2g->len && !bands3g->len && !bands4g->len) { # 1683| inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, # 1684| "no supported frequencies reported: %s", response); Error: GCC_ANALYZER_WARNING (CWE-476): [#def45] ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1625:1: enter_function: entry to ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1643:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1651:5: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1653:38: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1654:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1657:9: branch_false: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1657:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1661:16: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1664:12: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1665:13: branch_true: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1666:12: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1658:27: call_function: inlined call to ‘g_autoptr_cleanup_generic_gfree’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1672:8: branch_false: following ‘false’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: branch_false: ...to here ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1678:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1679:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1679:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1680:15: call_function: calling ‘parse_bands_from_string’ from ‘mm_ublox_parse_uact_test’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1680:15: return_function: returning to ‘mm_ublox_parse_uact_test’ from ‘parse_bands_from_string’ ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:8: branch_true: following ‘true’ branch... ModemManager-1.24.2/src/plugins/ublox/mm-modem-helpers-ublox.c:1682:44: danger: dereference of NULL ‘parse_bands_from_string(bands4g_str, "4G", log_object)’ # 1680| bands4g = parse_bands_from_string (bands4g_str, "4G", log_object); # 1681| # 1682|-> if (!bands2g->len && !bands3g->len && !bands4g->len) { # 1683| inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_FAILED, # 1684| "no supported frequencies reported: %s", response);
| analyzer-version-clippy | 1.95.0 |
| analyzer-version-cppcheck | 2.20.0 |
| analyzer-version-gcc | 16.1.1 |
| analyzer-version-gcc-analyzer | 16.1.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-151.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | ModemManager-1.24.2-4.fc45 |
| store-results-to | /tmp/tmpoe4j9gui/ModemManager-1.24.2-4.fc45.tar.xz |
| time-created | 2026-06-01 11:24:53 |
| time-finished | 2026-06-01 11:31:16 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,cppcheck,clippy,unicontrol,gcc' '-o' '/tmp/tmpoe4j9gui/ModemManager-1.24.2-4.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpoe4j9gui/ModemManager-1.24.2-4.fc45.src.rpm' |
| tool-version | csmock-3.8.5.20260529.133039.g6f3b5c6-1.el9 |