r20734: always terminate the string... so that an empty data_blob
authorStefan Metzmacher <metze@samba.org>
Sat, 13 Jan 2007 15:39:49 +0000 (15:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:40:34 +0000 (14:40 -0500)
gets '\0' as "" string

metze

source/lib/util/data_blob.c

index 7230aa9d99d4c9daab2cac99b3559bd3d6259672..e04bd653318684a55e10763fe9016242abc0bcaa 100644 (file)
@@ -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;
 }