Skip to content

Commit

Permalink
[mms_codec] Fixed parsing of the absolute date header. Fixes MER#1674
Browse files Browse the repository at this point in the history
  • Loading branch information
monich committed Oct 16, 2016
1 parent 289c94d commit c122d47
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mms-lib/src/mms_codec.c
Expand Up @@ -648,13 +648,18 @@ static gboolean extract_absolute_relative_date(struct wsp_header_iter *iter,
unsigned int i;
unsigned int seconds;

/*
* Address-present-token Encoded-string-value | Insert-address-token
* Address-present-token = <Octet 128>
* Insert-address-token = <Octet 129>
*/
if (wsp_header_iter_get_val_type(iter) != WSP_VALUE_TYPE_LONG)
return FALSE;

p = wsp_header_iter_get_val(iter);
l = wsp_header_iter_get_val_len(iter);

if (l < 2 || l > 5)
if (l < 2 || l > 6)
return FALSE;

if (p[0] != 128 && p[0] != 129)
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions mms-lib/test/test_mms_codec/test_mms_codec.c
Expand Up @@ -58,6 +58,7 @@ int main(int argc, char* argv[])
"m-notification_1.ind",
"m-notification_2.ind",
"m-notification_3.ind",
"m-notification_4.ind",
"m-delivery.ind",
"m-read-orig.ind",
"m-retrieve_1.conf",
Expand Down

0 comments on commit c122d47

Please sign in to comment.