3028. [bug] isc_sockaddr_format() handle a zero sized buffer.

[RT #22521]
This commit is contained in:
Mark Andrews
2011-02-21 06:21:24 +00:00
parent be1b103354
commit 167ed9d3f0
2 changed files with 7 additions and 1 deletions
+3
View File
@@ -1,3 +1,6 @@
3028. [bug] isc_sockaddr_format() handle a zero sized buffer.
[RT #22521]
3027. [bug] Add documented REQUIREs to cfg_obj_asnetprefix() to
catch NULL pointer dereferences before they happen.
[RT #22521]
+4 -1
View File
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: sockaddr.c,v 1.73 2010/11/17 23:47:09 tbox Exp $ */
/* $Id: sockaddr.c,v 1.73.38.1 2011/02/21 06:21:24 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) {