From: Adam Dickmeiss Date: Wed, 20 Jun 2012 13:19:03 +0000 (+0200) Subject: Fix record_render for case where len==NULL X-Git-Tag: v4.2.35~6 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=3e9a2da838e3e56d7a74958eff553f71199bbaa4 Fix record_render for case where len==NULL In which len is unset by record_render --- 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);