]> git.kaiwu.me - nginx.git/commit
Resolver: explicit check for compression pointers in question.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 25 May 2021 12:17:50 +0000 (15:17 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 25 May 2021 12:17:50 +0000 (15:17 +0300)
commitac18345675e4703efb843d06f96d596ab42c5dc5
tree536cba897813f2f3b19a9592a1ccda2b33b5f0e8
parentd1f51296bc175a897742572dc0be824a94df3f5a
Resolver: explicit check for compression pointers in question.

Since nginx always uses exactly one entry in the question section of
a DNS query, and never uses compression pointers in this entry, parsing
of a DNS response in ngx_resolver_process_response() does not expect
compression pointers to appear in the question section of the DNS
response.  Indeed, compression pointers in the first name of a DNS response
hardly make sense, do not seem to be allowed by RFC 1035 (which says
"a pointer to a prior occurance of the same name", note "prior"), and
were never observed in practice.

Added an explicit check to ngx_resolver_process_response()'s parsing
of the question section to properly report an error if compression pointers
nevertheless appear in the question section.
src/core/ngx_resolver.c