Commit db01df33 authored by Slava Monich's avatar Slava Monich

Merge branch 'expiry' into 'master'

Fix parsing of the absolute date header

It went unnoticed because usually the expiry time is relative.

See merge request !13
parents 2d9cc759 da0064d7
......@@ -642,13 +642,19 @@ static gboolean extract_absolute_relative_date(struct wsp_header_iter *iter,
unsigned int i;
unsigned int seconds;
/*
* Absolute-token Date-value | Relative-token Delta-seconds-value
* Absolute-token = <Octet 128>
* Relative-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)
/* Token (1 byte) + value length (1 byte) + up to 4 bytes */
if (l < 2 || l > 6)
return FALSE;
if (p[0] != 128 && p[0] != 129)
......
......@@ -59,6 +59,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",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment