Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request from GHSA-f5qg-pqcg-765m
  • Loading branch information
nanangizz committed Mar 22, 2022
1 parent 601f0c7 commit 560a134
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions pjmedia/src/pjmedia/sdp.c
Expand Up @@ -733,12 +733,21 @@ static int print_media_desc(const pjmedia_sdp_media *m, char *buf, pj_size_t len
pj_memcpy(p, m->desc.transport.ptr, m->desc.transport.slen);
p += m->desc.transport.slen;
for (i=0; i<m->desc.fmt_count; ++i) {
*p++ = ' ';
pj_memcpy(p, m->desc.fmt[i].ptr, m->desc.fmt[i].slen);
p += m->desc.fmt[i].slen;
if (end-p > m->desc.fmt[i].slen) {
*p++ = ' ';
pj_memcpy(p, m->desc.fmt[i].ptr, m->desc.fmt[i].slen);
p += m->desc.fmt[i].slen;
} else {
return -1;
}
}

if (end-p >= 2) {
*p++ = '\r';
*p++ = '\n';
} else {
return -1;
}
*p++ = '\r';
*p++ = '\n';

/* print connection info, if present. */
if (m->conn) {
Expand Down

0 comments on commit 560a134

Please sign in to comment.