[nginx] Resolver: fixed off-by-one write in ngx_resolver_copy().
Maxim Dounin
mdounin at mdounin.ru
Tue May 25 15:33:14 UTC 2021
details: https://hg.nginx.org/nginx/rev/2fd40ee19c20
branches:
changeset: 7849:2fd40ee19c20
user: Maxim Dounin <mdounin at mdounin.ru>
date: Tue May 25 15:17:36 2021 +0300
description:
Resolver: fixed off-by-one write in ngx_resolver_copy().
Reported by Luis Merino, Markus Vervier, Eric Sesterhenn, X41 D-Sec GmbH.
diffstat:
src/core/ngx_resolver.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (23 lines):
diff -r 1bde031b59ff -r 2fd40ee19c20 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Mon May 24 21:55:20 2021 +0300
+++ b/src/core/ngx_resolver.c Tue May 25 15:17:36 2021 +0300
@@ -4008,15 +4008,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) {
More information about the nginx-devel
mailing list