Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[mms_codec] Handle empty header values
  • Loading branch information
monich committed May 1, 2014
1 parent 21f7992 commit b8a79da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mms-lib/src/mms_codec.c
Expand Up @@ -473,6 +473,13 @@ static const char *decode_text(struct wsp_header_iter *iter)
const unsigned char *p;
unsigned int l;

if (wsp_header_iter_get_val_type(iter) == WSP_VALUE_TYPE_LONG) {
if (iter->len == 0) /* The only way to encode an empty string */
return (char*)(iter->pdu + iter->pos - 1);

return NULL;
}

if (wsp_header_iter_get_val_type(iter) != WSP_VALUE_TYPE_TEXT)
return NULL;

Expand Down

0 comments on commit b8a79da

Please sign in to comment.