Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ril] Allow CBS PDU arrive from RIL as a plain blob. JB#5761
I swear I've seen such cases!
  • Loading branch information
monich committed Jun 25, 2020
1 parent 550d41a commit dc41c2d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ofono/drivers/ril/ril_cbs.c
Expand Up @@ -165,9 +165,19 @@ static void ril_cbs_notify(GRilIoChannel *io, guint code,
if (grilio_parser_get_uint32(&rilp, &pdu_len)) {
const void* pdu = grilio_parser_get_bytes(&rilp, pdu_len);

if (pdu) {
/*
* By default assume that it's a length followed by the
* binary PDU data.
*/
if (pdu && grilio_parser_bytes_remaining(&rilp) < 4) {
DBG_(cd, "%u bytes", pdu_len);
ofono_cbs_notify(cd->cbs, pdu, pdu_len);
} else {
/*
* But I've seen cell broadcasts arriving without
* the length, simply as a blob.
*/
ofono_cbs_notify(cd->cbs, data, len);
}
}
}
Expand Down

0 comments on commit dc41c2d

Please sign in to comment.