]> git.kaiwu.me - nginx.git/commit
Rewrite: fixed segfault with rewritten URI and "alias".
authorRuslan Ermilov <ru@nginx.com>
Mon, 16 Dec 2019 12:19:01 +0000 (15:19 +0300)
committerRuslan Ermilov <ru@nginx.com>
Mon, 16 Dec 2019 12:19:01 +0000 (15:19 +0300)
commitaf8ea176a743e97d767b3e1439d549b52dd0367a
tree4abdb58cbe7e26b5f835b37ed2c5b751cc81edc1
parent48086f79ad7d9ac08943312f59215533330617d0
Rewrite: fixed segfault with rewritten URI and "alias".

The "alias" directive cannot be used in the same location where URI
was rewritten.  This has been detected in the "rewrite ... break"
case, but not when the standalone "break" directive was used.

This change also fixes proxy_pass with URI component in a similar
case:

       location /aaa/ {
           rewrite ^ /xxx/yyy;
           break;
           proxy_pass http://localhost:8080/bbb/;
       }

Previously, the "/bbb/yyy" would be sent to a backend instead of
"/xxx/yyy".  And if location's prefix was longer than the rewritten
URI, a segmentation fault might occur.
src/http/ngx_http_script.c