The branch, v3-2-test has been updated
       via  719ec00949094b7d3b01e9ac829183ae08f46417 (commit)
      from  088a6f42476782267c50f0a5ea029db0eede6cdd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 719ec00949094b7d3b01e9ac829183ae08f46417
Author: Volker Lendecke <[EMAIL PROTECTED]>
Date:   Thu Jul 10 18:12:24 2008 +0200

    Fix a segfault in base64_encode_data_blob
    
    We did not allocate enough memory for the \0 and a = at the end

-----------------------------------------------------------------------

Summary of changes:
 source/lib/util_str.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/util_str.c b/source/lib/util_str.c
index 6310e24..6678c0c 100644
--- a/source/lib/util_str.c
+++ b/source/lib/util_str.c
@@ -2345,7 +2345,9 @@ char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, 
DATA_BLOB data)
 
        out_cnt = 0;
        len = data.length;
-       output_len = data.length * 2;
+       output_len = data.length * 2 + 4; /* Account for closing bytes. 4 is
+                                          * random but should be enough for
+                                          * the = and \0 */
        result = TALLOC_ARRAY(mem_ctx, char, output_len); /* get us plenty of 
space */
        SMB_ASSERT(result != NULL);
 


-- 
Samba Shared Repository

Reply via email to