Skip to content

Commit 4052799

Browse files
committed
Bug fix (NAPTR record parsing)
1 parent 6931c39 commit 4052799

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/resty/dns/resolver.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,11 @@ local function parse_section(answers, section, buf, start_pos, size,
532532
end
533533
ans.regexp = regexp_str
534534

535-
if p - pos < len then
536-
local replacements_str,p = _decode_name(buf, p)
537-
if not replacements_str
538-
then return nil, pos
539-
end
540-
ans.replacements = replacements_str
535+
local replacements_str,p = _decode_name(buf, p)
536+
if not replacements_str
537+
then return nil, pos
541538
end
539+
ans.replacements = replacements_str
542540

543541
if p - pos ~= len then
544542
return nil, format("bad NAPTR record length: %d ~= %d",

0 commit comments

Comments
 (0)