laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/28479 )
Change subject: rtp: Delay rtph ptr assign after validating length ......................................................................
rtp: Delay rtph ptr assign after validating length
Make coverity happy, since this seems to spread as a tainted error further below.
Related: Coverity CID#273000 Change-Id: I5d457183043d4c902f473b828815b9c62a01d47d --- M src/rtp.c 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved
diff --git a/src/rtp.c b/src/rtp.c index 5718c5f..5c06c42 100644 --- a/src/rtp.c +++ b/src/rtp.c @@ -89,13 +89,14 @@
struct rtp_hdr *osmo_rtp_get_hdr(struct msgb *msg) { - struct rtp_hdr *rtph = (struct rtp_hdr *)msg->data; + struct rtp_hdr *rtph;
if (msg->len < sizeof(struct rtp_hdr)) { DEBUGPC(DLMUX, "received RTP frame too short (len = %d)\n", msg->len); return NULL; } + rtph = (struct rtp_hdr *)msg->data; if (rtph->version != RTP_VERSION) { DEBUGPC(DLMUX, "received RTP version %d not supported.\n", rtph->version);