From a4fe384f1d3ba07c4b91c7c5530e862b41355555 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 2 Apr 2003 00:03:52 +0000 Subject: OHKAWA Yuichi (kuri@makino.ecei.tohoku.ac.jp) points out that using decoded.length after it's been zero'ed out by data_blob_free() doesn't give you the original length... Andrew Bartlett (This used to be commit 647a720cfb06bdf0dfc8fcdcab50aadcceb0494d) --- source3/lib/util_str.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 4d955c59a7..e2f9f19f58 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1662,10 +1662,10 @@ void base64_decode_inplace(char *s) { DATA_BLOB decoded = base64_decode_data_blob(s); memcpy(s, decoded.data, decoded.length); - data_blob_free(&decoded); - /* null terminate */ s[decoded.length] = '\0'; + + data_blob_free(&decoded); } /** -- cgit