mirror of git://git.sysmocom.de/ofono
qmi: netmon: fix crashs on get_rssi_cb when BER or RSSI are empty
The message can be emitted without the fields being present. In this case ber or rssi are 0 resulting in a null pointer deref.
This commit is contained in:
parent
d604052cef
commit
64df5344c5
|
@ -89,8 +89,8 @@ static void get_rssi_cb(struct qmi_result *result, void *user_data)
|
|||
|
||||
/* RSSI */
|
||||
rssi = qmi_result_get(result, 0x11, &len);
|
||||
num = GUINT16_FROM_LE(rssi->count);
|
||||
if (rssi) {
|
||||
num = GUINT16_FROM_LE(rssi->count);
|
||||
for (i = 0; i < num; i++) {
|
||||
DBG("RSSI: %hhu on RAT %hhd",
|
||||
rssi->info[i].rssi,
|
||||
|
@ -126,8 +126,8 @@ static void get_rssi_cb(struct qmi_result *result, void *user_data)
|
|||
|
||||
/* Bit error rate */
|
||||
ber = qmi_result_get(result, 0x15, &len);
|
||||
num = GUINT16_FROM_LE(ber->count);
|
||||
if (ber) {
|
||||
num = GUINT16_FROM_LE(ber->count);
|
||||
for (i = 0; i < ber->count; i++) {
|
||||
DBG("Bit error rate: %hu on RAT %hhd",
|
||||
GUINT16_FROM_LE(ber->info[i].rate),
|
||||
|
|
Loading…
Reference in New Issue