pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33847 )
Change subject: rlcmac: Fix null ptr dereference ......................................................................
rlcmac: Fix null ptr dereference
Caught by ASan during test run. This can happen if gprs_rlcmac_ul_tbf_schedule_next_llc_frame() finds no more llc frames to submit during the loop iteration.
Change-Id: I5bd6dd6c6b7dc4b911af7bc119cf85eb810959a0 --- M src/rlcmac/tbf_ul.c 1 file changed, 14 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/src/rlcmac/tbf_ul.c b/src/rlcmac/tbf_ul.c index d9cd04a..0d78383 100644 --- a/src/rlcmac/tbf_ul.c +++ b/src/rlcmac/tbf_ul.c @@ -619,7 +619,7 @@ do { int payload_written = 0;
- if (msgb_length(ul_tbf->llc_tx_msg) == 0) { + if (!ul_tbf->llc_tx_msg || msgb_length(ul_tbf->llc_tx_msg) == 0) { /* The data just drained, store the current fn */ if (ul_tbf->last_ul_drained_fn < 0) ul_tbf->last_ul_drained_fn = bi->fn;