diff options
author | corvid <corvid@lavabit.com> | 2009-12-27 23:46:23 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2009-12-27 23:46:23 +0000 |
commit | b4d9ca82af1d62bc1f396592572169bfb8feba51 (patch) | |
tree | 4ae7ac6e84405634e7ec63e181f06cc78ec52be1 /dpi | |
parent | 6d2c86972555399632a16ffb9e75a7a97b523ddc (diff) |
handle whitespace following cookie attribute value
This isn't beautiful, but I don't want to make sweeping changes in
cookie parsing if I don't expect to test it much myself.
I think leading whitespace would be legal, too, but I won't worry about
that for now.
Diffstat (limited to 'dpi')
-rw-r--r-- | dpi/cookies.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dpi/cookies.c b/dpi/cookies.c index cf0cecf0..36052829 100644 --- a/dpi/cookies.c +++ b/dpi/cookies.c @@ -769,8 +769,12 @@ static char *Cookies_parse_value(char **cookie_str, case ' ': case '\t': if (!broken_syntax && str[0] != '\'' && str[0] != '"') { - *cookie_str = str + i + 1; end = 1; + *cookie_str = str + i + 1; + while (**cookie_str == ' ' || **cookie_str == '\t') + *cookie_str += 1; + if (**cookie_str == ';') + *cookie_str += 1; } break; case '\'': |