summaryrefslogtreecommitdiff
path: root/source4/smb_server
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-13 07:22:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:46 -0500
commita1a05543dc12b2414b74dcbe16231992f1104acd (patch)
tree6211fbcfb0f998f0bdd1ba53c2033507f2a50cf8 /source4/smb_server
parent263916cf71fce585daf68aedd5272f13c4677916 (diff)
downloadsamba-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')
-rw-r--r--source4/smb_server/request.c5
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) {