mirror of
https://github.com/samba-team/samba.git
synced 2025-10-21 03:33:16 +03:00
libcli/smb: Fix alignment problems of smb_bytes_pull_str()
This function needs to get the whole smb buffer in order to get the alignment for unicode correct. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12824 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
committed by
Andreas Schneider
parent
c786c61d1a
commit
e60e77a8af
@@ -210,16 +210,16 @@ static void smb1cli_session_setup_lm21_done(struct tevent_req *subreq)
|
||||
p = bytes;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_native_os,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
p += ret;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_native_lm,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
@@ -493,24 +493,24 @@ static void smb1cli_session_setup_nt1_done(struct tevent_req *subreq)
|
||||
p = bytes;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_native_os,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
p += ret;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_native_lm,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
p += ret;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_primary_domain,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
@@ -754,16 +754,16 @@ static void smb1cli_session_setup_ext_done(struct tevent_req *subreq)
|
||||
p += out_security_blob_length;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_native_os,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
p += ret;
|
||||
|
||||
status = smb_bytes_pull_str(state, &state->out_native_lm,
|
||||
use_unicode, p,
|
||||
bytes+num_bytes-p, &ret);
|
||||
use_unicode, bytes, num_bytes,
|
||||
p, &ret);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user