Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mms_codec] Handle PDUs containing unknown headers
Just stop parsing and return OK if all mandatory headers have been
successfully parsed. MMS codec doesn't handle many MMS 1.3 headers
and it's quite possible that we actually see those in the field.
They normally appear last and can be safely ignored.
  • Loading branch information
monich committed Feb 24, 2014
1 parent 8845148 commit 39e560d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mms-lib/src/mms_codec.c
Expand Up @@ -1008,9 +1008,10 @@ static gboolean mms_parse_headers(struct wsp_header_iter *iter,
p = wsp_header_iter_get_hdr(iter);
h = p[0] & 0x7f;

/* Stop parsing when we see an unknown header */
handler = handler_for_type(h);
if (handler == NULL)
return FALSE;
break;

/* Unsupported header, skip */
if (entries[h].data == NULL)
Expand All @@ -1021,9 +1022,9 @@ static gboolean mms_parse_headers(struct wsp_header_iter *iter,
!(entries[h].flags & HEADER_FLAG_ALLOW_MULTI))
continue;

/* Parse the header */
/* Parse the header, stop if we fail to parse it */
if (handler(iter, entries[h].data) == FALSE)
return FALSE;
break;

entries[h].pos = i;
entries[h].flags |= HEADER_FLAG_MARKED;
Expand Down

0 comments on commit 39e560d

Please sign in to comment.