diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-11-13 07:22:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:46 -0500 |
commit | a1a05543dc12b2414b74dcbe16231992f1104acd (patch) | |
tree | 6211fbcfb0f998f0bdd1ba53c2033507f2a50cf8 /source4/smb_server/request.c | |
parent | 263916cf71fce585daf68aedd5272f13c4677916 (diff) | |
download | samba-a1a05543dc12b2414b74dcbe16231992f1104acd.tar.gz samba-a1a05543dc12b2414b74dcbe16231992f1104acd.tar.bz2 samba-a1a05543dc12b2414b74dcbe16231992f1104acd.zip |
r3720: fixed the pulling of zero length ucs2 strings in smbd. I found this
bug using ifstest.exe, which is a IFS (Installable File System) test
suite. With this fix I was pleasantly surprised to find that Samba4
passes many (maybe even most?) of the tests in ifstest.
(This used to be commit a20cbca7880b66d3cf21213cccf93675e03f8728)
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r-- | source4/smb_server/request.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index fddf63b1f7..8e83ea31b3 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -489,6 +489,11 @@ static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const } src_len2 = utf16_len_n(src, src_len); + if (src_len2 == 0) { + *dest = talloc_strdup(req, ""); + return src_len2 + alignment; + } + ret = convert_string_talloc(req, CH_UTF16, CH_UNIX, src, src_len2, (void **)&dest2); if (ret == -1) { |