diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-07-20 13:34:08 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-07-20 14:18:35 +0200 |
commit | 427949ce758287e50b3a86a4b881be728e7474be (patch) | |
tree | 7e6c7947705e64f15cd169b1d4c0ed1bcbcfc0e7 | |
parent | 12311c25613688dbed1c7c4ca24b443009ac3725 (diff) |
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
-rw-r--r-- | src/rlcmac/tbf_ul.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 @@ static int create_new_bsn(struct gprs_rlcmac_ul_tbf *ul_tbf, const struct gprs_r 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; |