]> git.ipfire.org Git - thirdparty/asterisk.git/commit
AST-2018-010: Fix length of buffer needed for SRV and NAPTR results 16.0
authorGeorge Joseph <gjoseph@digium.com>
Thu, 25 Oct 2018 15:25:58 +0000 (09:25 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 14 Nov 2018 14:26:23 +0000 (09:26 -0500)
commit73e9a12a1b130dce77f6c2fcbba985149ade157c
treec99f855c5dfca73e2a1cd900eb14379c902d5631
parentf071e885b84a8def3405d05486061115fbd44ed6
AST-2018-010: Fix length of buffer needed for SRV and NAPTR results

When dn_expand was being called on SRV and NAPTR results, the
return value was being used to calculate the size of the buffer
needed to store the host names.  Since dn_expand returns the
length of the COMPRESSED name the buffer could be too short
to hold the EXPANDED name.  The expanded name is NULL terminated
so using strlen() is the correct way to determine the length
actually needed for the buffer.

ASTERISK-28127
Reported by: Jan Hoffmann

patches:
  patch.diff submitted by janhoffmann (license 6986)

Change-Id: I4d35d6c431c6c6836cb61d37b1378cc47f0b414d
main/dns_naptr.c
main/dns_srv.c