diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-04-02 11:19:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:59:43 -0500 |
commit | 508ba6026a0c958ac71762d36086742ec4825143 (patch) | |
tree | 8239a9581ad61ad86a7498d5e8c4008d3f16a1e7 /source4/libcli | |
parent | 64587cbf9eec5b44bd4b78c5e87d84d2ce7c344a (diff) | |
download | samba-508ba6026a0c958ac71762d36086742ec4825143.tar.gz samba-508ba6026a0c958ac71762d36086742ec4825143.tar.xz samba-508ba6026a0c958ac71762d36086742ec4825143.zip |
r14859: fix bugs noticed by the ibm code checker
metze
(This used to be commit afa8f944a7c572becd011b8c248eef13d7495ac7)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/raw/rawrequest.c | 20 |
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; |