Revert "In get_unicode_or_ascii_string(), check if the length is odd/even, not the...
authorStefan Metzmacher <metze@samba.org>
Fri, 3 Jan 2014 10:51:04 +0000 (11:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 29 Jan 2014 08:15:44 +0000 (09:15 +0100)
This is wrong it breaks all sort of things. The "Volume label field"
is a special case, which can be fixed by using nopad=TRUE.

Change-Id: I3cd3f30ff0076d5e31a735391b175fd68e5fa142
Signed-off-by: Stefan Metzmacher <metze@samba.org>
epan/dissectors/packet-smb-common.c

index 71e5e7aeda9cd94820e56d70a700caf2a04ccc7b..3711f1258bf512a5b289f42a950ab820ea1d446a 100644 (file)
@@ -238,7 +238,7 @@ get_unicode_or_ascii_string(tvbuff_t *tvb, int *offsetp,
        }
 
        if (useunicode) {
-               if ((!nopad) && (*bcp % 2)) {
+               if ((!nopad) && (*offsetp % 2)) {
                        (*offsetp)++;   /* Looks like a pad byte there sometimes */
                        (*bcp)--;