diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-08-11 20:31:18 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2022-08-11 20:31:18 +0200 |
commit | c8241421bcc1468697503ab1b61e8dea68fac2f1 (patch) | |
tree | d2768378c66c2d48d692516efc7f10236379537c /src | |
parent | e95ad0e66ed441ff049c63c6a5f2a69c0b6afd0e (diff) |
rtp: Avoid memcpy(len=0)
Change-Id: I7618c6509b67465d21271ea632bccc8cf11e4852
Diffstat (limited to 'src')
-rw-r--r-- | src/rtp.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; |