From 7ee225cf90fd06de61682b442600af88b68b99db 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] --- CHANGES | 8 +++++--- bin/named/statschannel.c | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index cf53b7b0ca..e3491ac047 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3586. [buf] Handle errors in xmlDocDumpFormatMemoryEnc. [RT #33706] + 3585. [func] "rndc delzone -clean" option removes zone files when deleting a zone. [RT #33570] @@ -40,7 +42,7 @@ [RT #33234] 3570. [bug] Check internal pointers are valid when loading map - files. [RT #33403] + files. [RT #33403] 3569. [contrib] Ported mysql DLZ driver to dynamically-loadable module, and added multithread support. [RT #33394] @@ -52,7 +54,7 @@ 3566. [func] Log when forwarding updates to master. [RT #33240] -3565. [placeholder] +3565. [placeholder] 3564. [bug] Improved handling of corrupted map files. [RT #33380] @@ -64,7 +66,7 @@ 3561. [bug] dig: issue a warning if an EDNS query returns FORMERR or NOTIMP. Adjust usage message. [RT #33363] - + 3560. [bug] isc-config.sh did not honor includedir and libdir when set via configure. [RT #33345] diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c index 466fdc12a2..d3c74f937f 100644 --- a/bin/named/statschannel.c +++ b/bin/named/statschannel.c @@ -1185,6 +1185,8 @@ generatexml(ns_server_t *server, int *buflen, xmlChar **buf) { xmlFreeTextWriter(writer); xmlDocDumpFormatMemoryEnc(doc, buf, buflen, "UTF-8", 0); + if (*buf == NULL) + goto error; xmlFreeDoc(doc); return (ISC_R_SUCCESS); @@ -1211,7 +1213,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;