From c186fb94637f2cd502327c38d95c6d7a2b2dbd11 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 13 Jan 2007 15:39:49 +0000 Subject: r20734: always terminate the string... so that an empty data_blob gets '\0' as "" string metze (This used to be commit 4f5daa830a3c02a05ba1bc7f32eedbe1d52640a1) --- source4/lib/util/data_blob.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/lib/util') diff --git a/source4/lib/util/data_blob.c b/source4/lib/util/data_blob.c index 7230aa9d99..e04bd65331 100644 --- a/source4/lib/util/data_blob.c +++ b/source4/lib/util/data_blob.c @@ -163,6 +163,7 @@ _PUBLIC_ char *data_blob_hex_string(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob) for (i = 0; i < blob->length; i++) slprintf(&hex_string[i*2], 3, "%02X", blob->data[i]); + hex_string[(blob->length*2)] = '\0'; return hex_string; } -- cgit