From a1a05543dc12b2414b74dcbe16231992f1104acd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 13 Nov 2004 07:22:14 +0000 Subject: 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) --- source4/smb_server/request.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/smb_server') 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) { -- cgit