From 7eee4947f30ba1526fadcb3157999e03c0b105e7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 21 Aug 2012 15:46:54 -0700 Subject: 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(). --- source3/libsmb/clilist.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3') 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 -- cgit