Browse Source

MT#63317 fix RTP extension parsing

Change-Id: Ie62fa4ed2dc16d42d579c34b1fe541955759dfed
(cherry picked from commit 262d1f7b5e)
mr13.4
Richard Fuchs 5 months ago
parent
commit
76c0ab47a6
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      kernel-module/xt_RTPENGINE.c
  2. +1
    -1
      lib/rtplib.c

+ 2
- 2
kernel-module/xt_RTPENGINE.c View File

@ -5132,7 +5132,7 @@ drop:
/* XXX shared code */
static void parse_rtp(struct rtp_parsed *rtp, struct sk_buff *skb) {
struct rtp_extension *ext;
int ext_len;
size_t ext_len;
if (skb->len < sizeof(*rtp->rtp_header))
goto error;
@ -5153,7 +5153,7 @@ static void parse_rtp(struct rtp_parsed *rtp, struct sk_buff *skb) {
if (rtp->payload_len < sizeof(*ext))
goto error;
ext = (void *) rtp->payload;
ext_len = 4 + ntohs(ext->length) * 4;
ext_len = sizeof(*ext) + 4 + ntohs(ext->length) * 4;
if (rtp->payload_len < ext_len)
goto error;
rtp->payload += ext_len;


+ 1
- 1
lib/rtplib.c View File

@ -91,7 +91,7 @@ int rtp_payload(struct rtp_header **out, str *p, const str *s) {
goto error;
ext = (void *) p->s;
err = "short packet (header extensions)";
if (str_shift(p, 4 + ntohs(ext->length) * 4))
if (str_shift(p, sizeof(*ext) + 4 + ntohs(ext->length) * 4))
goto error;
}


Loading…
Cancel
Save