shared-qmi: fix use of uninitialized memory

==636642== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
    ==636642==    at 0x5282BAC: send (in /usr/lib/libpthread-2.33.so)
    ==636642==    by 0x4EF20AF: UnknownInlinedFun (gsocket.c:3426)
    ==636642==    by 0x4EF20AF: g_socket_send_with_blocking (gsocket.c:3529)
    ==636642==    by 0x4EDF176: g_output_stream_write (goutputstream.c:242)
    ==636642==    by 0x4EDF2D4: g_output_stream_write_all (goutputstream.c:301)
    ==636642==    by 0x4A5CDAC: endpoint_send (qmi-endpoint-qmux.c:409)
    ==636642==    by 0x4A5B963: qmi_endpoint_send (qmi-endpoint.c:225)
    ==636642==    by 0x4A55408: qmi_device_command_abortable (qmi-device.c:2897)
    ==636642==    by 0x4A554C3: qmi_device_command_full (qmi-device.c:2923)
    ==636642==    by 0x4B52664: qmi_client_nas_set_system_selection_preference (qmi-nas.c:61099)
    ==636642==    by 0x1F6FDC: register_in_network_sssp (mm-shared-qmi.c:455)
    ==636642==    by 0x1F71E6: mm_shared_qmi_3gpp_register_in_network (mm-shared-qmi.c:505)
    ==636642==    by 0x19FCF0: mm_iface_modem_3gpp_register_in_network (mm-iface-modem-3gpp.c:484)
    ==636642==  Address 0x880a3b3 is 19 bytes inside a block of size 32 alloc'd
    ==636642==    at 0x484383F: realloc (vg_replace_malloc.c:1192)
    ==636642==    by 0x50DC130: g_realloc (gmem.c:171)
    ==636642==    by 0x50A067C: g_array_maybe_expand (garray.c:1009)
    ==636642==    by 0x50A0A0C: UnknownInlinedFun (garray.c:520)
    ==636642==    by 0x50A0A0C: g_array_append_vals (garray.c:509)
    ==636642==    by 0x50A0A9E: g_byte_array_append (garray.c:2430)
    ==636642==    by 0x4A4B70D: qmi_message_tlv_write_guint8 (qmi-message.c:686)
    ==636642==    by 0x4B14CA8: __qmi_message_nas_set_system_selection_preference_request_create (qmi-nas.c:33477)
    ==636642==    by 0x4B525B6: qmi_client_nas_set_system_selection_preference (qmi-nas.c:61087)
    ==636642==    by 0x1F6FDC: register_in_network_sssp (mm-shared-qmi.c:455)
    ==636642==    by 0x1F71E6: mm_shared_qmi_3gpp_register_in_network (mm-shared-qmi.c:505)
    ==636642==    by 0x19FCF0: mm_iface_modem_3gpp_register_in_network (mm-iface-modem-3gpp.c:484)
    ==636642==    by 0x1B0BD4: check_next_registration (mm-iface-modem-simple.c:154)
This commit is contained in:
Aleksander Morgado
2021-07-12 22:10:41 +02:00
parent a61422761f
commit 3ffa6b8960
+1 -1
View File
@@ -473,7 +473,7 @@ mm_shared_qmi_3gpp_register_in_network (MMIfaceModem3gpp *self,
GTask *task;
RegisterInNetworkContext *ctx;
guint16 mcc = 0;
guint16 mnc;
guint16 mnc = 0;
gboolean mnc_pcs_digit = FALSE;
QmiClient *client = NULL;
GError *error = NULL;