aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2022-08-11 20:31:18 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2022-08-11 20:31:18 +0200
commitc8241421bcc1468697503ab1b61e8dea68fac2f1 (patch)
treed2768378c66c2d48d692516efc7f10236379537c /src
parente95ad0e66ed441ff049c63c6a5f2a69c0b6afd0e (diff)
rtp: Avoid memcpy(len=0)
Diffstat (limited to 'src')
-rw-r--r--src/rtp.c3
1 files changed, 2 insertions, 1 deletions
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 @@ osmo_rtp_build(struct osmo_rtp_handle *h, uint8_t payload_type,
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;