]> git.ipfire.org Git - thirdparty/asterisk.git/commit
AST-2018-010: Fix length of buffer needed for SRV and NAPTR results
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:25:32 +0000 (09:25 -0500)
commiteb5b83b8ea1bbd3044d958d19d8852513d3608b0
tree287c949ef76203bc20252b9cda78d514f20cdeb5
parent9e151413dba6f1d21608209e9ebffeda83bf762c
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