Fix bug in SMB_FIND_INFO_STANDARD parsing found by Volker.
authorJeremy Allison <jra@samba.org>
Tue, 21 Aug 2012 22:46:54 +0000 (15:46 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 22 Aug 2012 17:03:20 +0000 (10:03 -0700)
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

index 6185c5a99739c842ff4174f0118db0bc42bcd8f7..056494e3351b8fbf26ab52a4b4dd510c41aefcbb 100644 (file)
@@ -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