comparison src/http/ngx_http_core_module.h @ 8121:4eb1383f6432

Fixed handling of very long locations (ticket #2435). Previously, location prefix length in ngx_http_location_tree_node_t was stored as "u_char", and therefore location prefixes longer than 255 bytes were handled incorrectly. Fix is to use "u_short" instead. With "u_short", prefixes up to 65535 bytes can be safely used, and this isn't reachable due to NGX_CONF_BUFFER, which is 4096 bytes.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 26 Jan 2023 03:34:44 +0300
parents ef6a3a99a81a
children 106328a70f4e
comparison
equal deleted inserted replaced
8120:c7e103acb409 8121:4eb1383f6432
461 ngx_http_location_tree_node_t *tree; 461 ngx_http_location_tree_node_t *tree;
462 462
463 ngx_http_core_loc_conf_t *exact; 463 ngx_http_core_loc_conf_t *exact;
464 ngx_http_core_loc_conf_t *inclusive; 464 ngx_http_core_loc_conf_t *inclusive;
465 465
466 u_short len;
466 u_char auto_redirect; 467 u_char auto_redirect;
467 u_char len;
468 u_char name[1]; 468 u_char name[1];
469 }; 469 };
470 470
471 471
472 void ngx_http_core_run_phases(ngx_http_request_t *r); 472 void ngx_http_core_run_phases(ngx_http_request_t *r);