Skip to content

Commit

Permalink
Fix \\ bug
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdubbelboer committed Aug 16, 2015
1 parent 9a40204 commit 9d77dcc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ngx_http_auth_digest_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ ngx_http_auth_digest_check_credentials(ngx_http_request_t *r, ngx_http_auth_dige
}
else if (ch == '\\' && *p <= 0x7f) {
quoted_pair_count++;
/* Skip the next char, even if it's a \ */
ch = *(p += 2);
}
else if (ch == '\"') {
Expand All @@ -490,7 +491,16 @@ ngx_http_auth_digest_check_credentials(ngx_http_request_t *r, ngx_http_auth_dige
u_char *s = start;
for (; s < end; s++) {
ch = *s;
if (ch == '\\') continue;
if (ch == '\\') {
/* Make sure to add the next character
* even if it's a \
*/
s++;
if (s < end) {
*d++ = ch;
}
continue;
}
*d++ = ch;
}
}
Expand Down

0 comments on commit 9d77dcc

Please sign in to comment.