]> git.ipfire.org Git - thirdparty/asterisk.git/commit
AST-2018-010: Fix length of buffer needed for SRV and NAPTR results 15.6
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:12 +0000 (09:26 -0500)
commitae857488d97f94535d7c4dbe6049ddcc211bcf32
treedfea0ba04d8ae1578f76ae758428c62d7073f815
parent50bc875be6db48cbcaece56add2ebbca26dbb54b
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