summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-08-21 15:46:54 -0700
committerJeremy Allison <jra@samba.org>2012-08-22 10:03:20 -0700
commit7eee4947f30ba1526fadcb3157999e03c0b105e7 (patch)
tree5f2449c00fe500e99712d8eda83a7160c4d02dc5
parent1219eaffbe60ea875306f84d3ce7965ce4ae6384 (diff)
downloadsamba-7eee4947f30ba1526fadcb3157999e03c0b105e7.tar.gz
samba-7eee4947f30ba1526fadcb3157999e03c0b105e7.tar.bz2
samba-7eee4947f30ba1526fadcb3157999e03c0b105e7.zip
Fix bug in SMB_FIND_INFO_STANDARD parsing found by Volker.
The function align_string() is now broken as base_ptr no longer points at the start of the SMB data packet, but at the start of the returned TRANS2 data area. Replace it with a check for FLAGS2_UNICODE_STRINGS and a call to ucs2_align().
-rw-r--r--source3/libsmb/clilist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 6185c5a997..056494e335 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -87,7 +87,9 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
finfo->mode = CVAL(p,24);
len = CVAL(p, 26);
p += 27;
- p += align_string(base_ptr, p, 0);
+ if (recv_flags2 & FLAGS2_UNICODE_STRINGS) {
+ p += ucs2_align(base_ptr, p, STR_UNICODE);
+ }
/* We can safely use len here (which is required by OS/2)
* and the NAS-BASIC server instead of +2 or +1 as the