pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/29044 )


Change subject: rtp: Avoid memcpy(len=0)
......................................................................

rtp: Avoid memcpy(len=0)

Change-Id: I7618c6509b67465d21271ea632bccc8cf11e4852
---
M src/rtp.c
1 file changed, 2 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/44/29044/1

diff --git a/src/rtp.c b/src/rtp.c
index 5c06c42..f4b0ada 100644
--- a/src/rtp.c
+++ b/src/rtp.c
@@ -199,7 +199,8 @@
        rtph->timestamp = htonl(h->tx.timestamp);
        h->tx.timestamp += duration;
        rtph->ssrc = htonl(h->tx.ssrc);
-       memcpy(msg->data + sizeof(struct rtp_hdr), data, payload_len);
+       if (payload_len > 0)
+               memcpy(msg->data + sizeof(struct rtp_hdr), data, payload_len);
        msgb_put(msg, sizeof(struct rtp_hdr) + payload_len);

        return msg;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29044
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

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

Reply via email to