Browse Source

fix possible core dump when processing certain malformed SDP

Change-Id: I3240f09033d7e587c48f8baa315953c553b99f0b
changes/48/22748/1
Richard Fuchs 7 years ago
parent
commit
178391e177
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      daemon/sdp.c

+ 6
- 0
daemon/sdp.c View File

@ -1382,6 +1382,9 @@ INLINE void chopper_append_str(struct sdp_chopper *c, const str *s) {
static int copy_up_to_ptr(struct sdp_chopper *chop, const char *b) {
int offset, len;
if (!b)
return 0;
offset = b - chop->input->s;
assert(offset >= 0);
assert(offset <= chop->input->len);
@ -1411,6 +1414,9 @@ static void copy_remainder(struct sdp_chopper *chop) {
static int skip_over(struct sdp_chopper *chop, str *where) {
int offset, len;
if (!where || !where->s)
return 0;
offset = (where->s - chop->input->s) + where->len;
assert(offset >= 0);
assert(offset <= chop->input->len);


Loading…
Cancel
Save