Skip to content

Commit 4b5ec7e

Browse files
authored
bugfix: applied the patch for security advisory to NGINX cores >= 0.6.18 and <= 1.20.0 (CVE-2021-23017). (#739)
1 parent 42410a7 commit 4b5ec7e

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

patches/patch.2021.resolver.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git src/core/ngx_resolver.c src/core/ngx_resolver.c
2+
--- src/core/ngx_resolver.c
3+
+++ src/core/ngx_resolver.c
4+
@@ -4008,15 +4008,15 @@ done:
5+
n = *src++;
6+
7+
} else {
8+
+ if (dst != name->data) {
9+
+ *dst++ = '.';
10+
+ }
11+
+
12+
ngx_strlow(dst, src, n);
13+
dst += n;
14+
src += n;
15+
16+
n = *src++;
17+
-
18+
- if (n != 0) {
19+
- *dst++ = '.';
20+
- }
21+
}
22+
23+
if (n == 0) {

util/mirror-tarballs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,16 @@ else
469469
echo
470470
fi
471471

472+
answer=`$root/util/ver-ge "$main_ver" 0.6.18`
473+
if [ "$answer" = "Y" ]; then
474+
answer=`$root/util/ver-ge "$main_ver" 1.20.1`
475+
if [ "$answer" = "N" ]; then
476+
echo "$info_txt applying the patch for nginx security advisory (CVE-2021-23017)"
477+
patch -p0 < $root/patches/patch.2021.resolver.txt || exit 1
478+
echo
479+
fi
480+
fi
481+
472482
echo "$info_txt applying the upstream_timeout_fields patch for nginx"
473483
patch -p1 < $root/patches/nginx-$main_ver-upstream_timeout_fields.patch || exit 1
474484
echo

0 commit comments

Comments
 (0)