The Samba-Bugzilla – Attachment 3678 Details for
Bug 5826
Directory/Filenames get truncated when 3.2.0 client acesses old server
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 3.2
look (text/plain), 779 bytes, created by
Jeremy Allison
on 2008-10-16 13:57:37 UTC
(
hide
)
Description:
Patch for 3.2
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2008-10-16 13:57:37 UTC
Size:
779 bytes
patch
obsolete
>diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c >index cea234f..eec7ae3 100644 >--- a/source/lib/charcnv.c >+++ b/source/lib/charcnv.c >@@ -1209,7 +1209,21 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx, > if (dest_len && dest) { > /* Did we already process the terminating zero ? */ > if (dest[dest_len-1] != 0) { >- dest[dest_len-1] = 0; >+ size_t size = talloc_get_size(dest); >+ /* Have we got space to append the '\0' ? */ >+ if (size <= dest_len) { >+ /* No, realloc. */ >+ dest = TALLOC_REALLOC_ARRAY(ctx, dest, char, >+ dest_len+1); >+ if (!dest) { >+ /* talloc fail. */ >+ dest_len = (size_t)-1; >+ return 0; >+ } >+ } >+ /* Yay - space ! */ >+ dest[dest_len] = '\0'; >+ dest_len++; > } > } else if (dest) { > dest[0] = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5826
: 3678