From 8a3b1acf35cf8b9d823cb29c81aecff70ccdc178 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 27 Sep 2022 18:26:48 +0200 Subject: [PATCH] osmux: assert no batch factor greater than 8 is used Change-Id: Ie17a8174bc220d091cb7ff880363d22179b4f621 --- src/osmux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osmux.c b/src/osmux.c index 2a5dcc9..9ac0a7e 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -318,7 +318,8 @@ static int osmux_batch_enqueue(struct msgb *msg, struct osmux_circuit *circuit, /* Validate amount of messages per batch. The counter field of the * osmux header is just 3 bits long, so make sure it doesn't overflow. */ - if (circuit->nmsgs >= batch_factor || circuit->nmsgs >= 8) { + OSMO_ASSERT(batch_factor <= 8); + if (circuit->nmsgs >= batch_factor) { struct rtp_hdr *rtph; rtph = osmo_rtp_get_hdr(msg);