Ticket #2396: encoded-deny.patch

File encoded-deny.patch, 783 bytes (added by ymartin-ovh@…, 4 years ago)
  • src/http/ngx_http_parse.c

    diff -aruN nginx-1.21.6/src/http/ngx_http_parse.c nginx/src/http/ngx_http_parse.c
    old new  
    15261526                    ch = *p++;
    15271527                    break;
    15281528
    1529                 } else if (ch == '\0') {
     1529                } else if (ch < 0x20 || ch == 0x7f) {
    15301530                    return NGX_HTTP_PARSE_INVALID_REQUEST;
    15311531                }
    15321532
     
    15461546
    15471547                } else if (ch == '+') {
    15481548                    r->plus_in_uri = 1;
     1549                } else if (ch < 0x20 || ch == 0x7f) {
     1550                    return NGX_HTTP_PARSE_INVALID_REQUEST;
    15491551                }
    15501552
    15511553                state = quoted_state;