mirror of
https://github.com/samba-team/samba.git
synced 2025-11-15 16:23:49 +03:00
r14859: fix bugs noticed by the ibm code checker
metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
152e7e3d02
commit
afa8f944a7
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user