Skip to content

Commit d502e41

Browse files
bugfix: nginx crash when accessing uninitialized pointer.
1 parent 91eb0db commit d502e41

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
matrix:
2424
- NGINX_VERSION=1.19.3
2525
- NGINX_VERSION=1.19.9
26-
- NGINX_VERSION=1.23.0
26+
- NGINX_VERSION=1.23.0 WITHOUT_PCRE2=1
2727

2828
before_install:
2929
- sudo apt-get update -y

src/ngx_http_headers_more_headers_in.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ ngx_http_set_header_helper(ngx_http_request_t *r,
335335

336336
h->key = hv->key;
337337
h->value = *value;
338+
#if defined(nginx_version) && nginx_version >= 1023000
339+
h->next = NULL;
340+
#endif
338341

339342
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
340343
if (h->lowcase_key == NULL) {

util/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ root=`pwd`
66
version=$1
77
home=~
88
force=$2
9+
pcre2_opt=""
10+
if [ "$WITHOUT_PCRE2" = "1" ]; then
11+
pcre2_opt="--without-pcre2"
12+
fi
913

1014
#--with-cc=gcc46 \
1115

@@ -21,6 +25,7 @@ ngx-build $force $version \
2125
--without-http_autoindex_module \
2226
--without-http_auth_basic_module \
2327
--without-http_userid_module \
28+
$pcre2_opt \
2429
--with-http_realip_module \
2530
--with-http_dav_module \
2631
--add-module=$root/../eval-nginx-module \

0 commit comments

Comments
 (0)