neels has uploaded this change for review.

View Change

coverity

Make sure the signed operation works as expected, by casting to int
before the operation takes place.

Change-Id: I30beeac45ff2d8c08905986af9fabfda071ddc5b
---
M src/rtp.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/92/37992/1
diff --git a/src/rtp.c b/src/rtp.c
index f4b0ada..bed587d 100644
--- a/src/rtp.c
+++ b/src/rtp.c
@@ -117,7 +117,7 @@

csrc_len = rtph->csrc_count << 2;
payload = msg->data + sizeof(struct rtp_hdr) + csrc_len;
- payload_len = msg->len - sizeof(struct rtp_hdr) - csrc_len;
+ payload_len = ((int)msg->len) - sizeof(struct rtp_hdr) - csrc_len;
if (payload_len < 0) {
DEBUGPC(DLMUX, "received RTP frame too short (len = %d, "
"csrc count = %d)\n", msg->len, rtph->csrc_count);

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

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I30beeac45ff2d8c08905986af9fabfda071ddc5b
Gerrit-Change-Number: 37992
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>