The Samba-Bugzilla – Attachment 6362 Details for
Bug 8040
smbclient segfaults when a Cyrillic netbios name or workgroup is configured
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Second part of fix.
0001-alpha_strcpy-is-a-utility-function-which-reportedly.patch (text/plain), 1.68 KB, created by
Jeremy Allison
on 2011-04-01 18:48:25 UTC
(
hide
)
Description:
Second part of fix.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2011-04-01 18:48:25 UTC
Size:
1.68 KB
patch
obsolete
>From e356094109ecf67d6ff1a3b0a6be2661909570cd Mon Sep 17 00:00:00 2001 >From: David Disseldorp <ddiss@suse.de> >Date: Fri, 1 Apr 2011 11:21:59 -0700 >Subject: [PATCH] alpha_strcpy() is a utility function which reportedly: > Strips out all but 'a-Z0-9' and the character in other_safe_chars and > replaces with '_'. >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This statement does not currently hold true in all cases (e.g. src = >"ТÐÐЦÐÐÐТЬ"). >--- > source3/lib/util_str.c | 12 +++++++++--- > 1 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c >index 3da2b83..d869637 100644 >--- a/source3/lib/util_str.c >+++ b/source3/lib/util_str.c >@@ -586,7 +586,9 @@ char *safe_strcat_fn(const char *fn, > Paranoid strcpy into a buffer of given length (includes terminating > zero. Strips out all but 'a-Z0-9' and the character in other_safe_chars > and replaces with '_'. Deliberately does *NOT* check for multibyte >- characters. Don't change it ! >+ characters. Treats src as an array of bytes, not as a multibyte >+ string. Any byte >0x7f is automatically converted to '_'. >+ other_safe_chars must also contain an ascii string (bytes<0x7f). > **/ > > char *alpha_strcpy_fn(const char *fn, >@@ -622,8 +624,12 @@ char *alpha_strcpy_fn(const char *fn, > > for(i = 0; i < len; i++) { > int val = (src[i] & 0xff); >- if (isupper_ascii(val) || islower_ascii(val) || >- isdigit(val) || strchr_m(other_safe_chars, val)) >+ if (val > 0x7f) { >+ dest[i] = '_'; >+ continue; >+ } >+ if (isupper(val) || islower(val) || >+ isdigit(val) || strchr(other_safe_chars, val)) > dest[i] = src[i]; > else > dest[i] = '_'; >-- >1.7.3.1 >
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
Flags:
vl
:
review+
Actions:
View
Attachments on
bug 8040
:
6346
|
6361
| 6362