summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/raw/rawrequest.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index b07a92e3fa..24390cd9e7 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -850,13 +850,17 @@ size_t smbcli_blob_pull_string(struct smbcli_session *session,
int extra;
dest->s = NULL;
- /* this is here to cope with SMB2 calls using the SMB
- parsers. SMB2 will pass smbcli_session==NULL, which forces
- unicode on (as used by SMB2) */
- if (session == NULL && !(flags & STR_ASCII)) {
- flags |= STR_UNICODE;
+ if (!(flags & STR_ASCII)) {
+ /* this is here to cope with SMB2 calls using the SMB
+ parsers. SMB2 will pass smbcli_session==NULL, which forces
+ unicode on (as used by SMB2) */
+ if (session == NULL) {
+ flags |= STR_UNICODE;
+ } else if (session->transport->negotiate.capabilities & CAP_UNICODE) {
+ flags |= STR_UNICODE;
+ }
}
-
+
if (flags & STR_LEN8BIT) {
if (len_offset > blob->length-1) {
return 0;
@@ -870,9 +874,7 @@ size_t smbcli_blob_pull_string(struct smbcli_session *session,
}
extra = 0;
dest->s = NULL;
- if (!(flags & STR_ASCII) &&
- ((flags & STR_UNICODE) ||
- (session->transport->negotiate.capabilities & CAP_UNICODE))) {
+ if (!(flags & STR_ASCII) && (flags & STR_UNICODE)) {
int align = 0;
if ((str_offset&1) && !(flags & STR_NOALIGN)) {
align = 1;