pespin has uploaded this change for review.

View Change

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(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/79/28479/1
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);

To view, visit change 28479. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I5d457183043d4c902f473b828815b9c62a01d47d
Gerrit-Change-Number: 28479
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange