3029. [bug] isc_netaddr_format() handle a zero sized buffer.

[RT #22521]
This commit is contained in:
Mark Andrews
2011-02-21 06:35:02 +00:00
parent 6995206cb4
commit f5d6a36457
2 changed files with 7 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: netaddr.c,v 1.38 2007/06/18 23:47:44 tbox Exp $ */
/* $Id: netaddr.c,v 1.38.332.1 2011/02/21 06:35:02 marka Exp $ */
/*! \file */
@@ -188,6 +188,9 @@ isc_netaddr_format(const isc_netaddr_t *na, char *array, unsigned int size) {
isc_buffer_init(&buf, array, size);
result = isc_netaddr_totext(na, &buf);
if (size == 0)
return;
/*
* Null terminate.
*/