From 39ea40d90694ae611ba3215ae6ac6ec7cef441ff Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 6 Jun 2013 10:55:08 +1000 Subject: [PATCH] 3586. [buf] Handle errors in xmlDocDumpFormatMemoryEnc. [RT #33706] (cherry picked from commit 7ee225cf90fd06de61682b442600af88b68b99db) --- CHANGES | 2 ++ bin/named/statschannel.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 00ad6785ae..ed547f2872 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3586. [buf] Handle errors in xmlDocDumpFormatMemoryEnc. [RT #33706] + 3584. [security] Caching data from an incompletely signed zone could trigger an assertion failure in resolver.c [RT #33690] diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index 8d30b452f2..e4f56e210f 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -958,6 +958,8 @@ generatexml(ns_server_t *server, int *buflen, xmlChar **buf) { xmlFreeTextWriter(writer); xmlDocDumpFormatMemoryEnc(doc, buf, buflen, "UTF-8", 1); + if (*buf == NULL) + goto error; xmlFreeDoc(doc); return (ISC_R_SUCCESS); @@ -982,7 +984,7 @@ render_index(const char *url, const char *querystring, void *arg, isc_buffer_t *b, isc_httpdfree_t **freecb, void **freecb_args) { - unsigned char *msg; + unsigned char *msg = NULL; int msglen; ns_server_t *server = arg; isc_result_t result;