nginx/nginx-1.18.0-CVE-2021-23017.patch

25 lines
536 B
Diff

diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
index e51712c..4e75ab8 100644
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -3993,15 +3993,15 @@ done:
n = *src++;
} else {
+ if (dst != name->data) {
+ *dst++ = '.';
+ }
+
ngx_strlow(dst, src, n);
dst += n;
src += n;
n = *src++;
-
- if (n != 0) {
- *dst++ = '.';
- }
}
if (n == 0) {