From 3e9a2da838e3e56d7a74958eff553f71199bbaa4 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 20 Jun 2012 15:19:03 +0200 Subject: [PATCH] Fix record_render for case where len==NULL In which len is unset by record_render --- src/record_render.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/record_render.c b/src/record_render.c index 983667a..69a208b 100644 --- a/src/record_render.c +++ b/src/record_render.c @@ -276,7 +276,7 @@ static const char *base64_render(NMEM nmem, WRBUF wrbuf, const char *expr, const char *type_spec) { #if YAZ_HAVE_XML2 - xmlDocPtr doc = xmlParseMemory(buf, *len); + xmlDocPtr doc = xmlParseMemory(buf, strlen(buf)); if (doc) { xmlChar *buf_out; @@ -325,7 +325,8 @@ static const char *base64_render(NMEM nmem, WRBUF wrbuf, wrbuf_rewind(wrbuf); wrbuf_write(wrbuf, (const char *) buf_out, len_out); buf = wrbuf_cstr(wrbuf); - *len = len_out; + if (len) + *len = len_out; } xmlFreeDoc(doc); xmlFree(buf_out); -- 1.7.10.4