From baab4442224fb82318891b29a4bb320d9e8ba6fb Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 16 Nov 2010 00:42:35 +0000 Subject: [PATCH] isc_sockaddr_format() check for sies equal 0 --- lib/isc/sockaddr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/isc/sockaddr.c b/lib/isc/sockaddr.c index 62975df34d..a3bb53afd4 100644 --- a/lib/isc/sockaddr.c +++ b/lib/isc/sockaddr.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: sockaddr.c,v 1.70 2007/06/19 23:47:17 tbox Exp $ */ +/* $Id: sockaddr.c,v 1.71 2010/11/16 00:42:35 marka Exp $ */ /*! \file */ @@ -182,6 +182,9 @@ isc_sockaddr_format(const isc_sockaddr_t *sa, char *array, unsigned int size) { isc_result_t result; isc_buffer_t buf; + if (size == 0U) + return; + isc_buffer_init(&buf, array, size); result = isc_sockaddr_totext(sa, &buf); if (result != ISC_R_SUCCESS) {