/* Copy out parameters */
*state->orig.out.entry_handle = *state->tmp.out.entry_handle;
*state->orig.out.num_ents = *state->tmp.out.num_ents;
- if ((*state->tmp.out.num_ents) > (state->tmp.in.max_ents)) {
- tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
- return;
+ {
+ size_t _copy_len_entries;
+ if ((*state->tmp.out.num_ents) > (state->tmp.in.max_ents)) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
+ return;
+ }
+ _copy_len_entries = *state->tmp.out.num_ents;
+ memcpy(state->orig.out.entries, state->tmp.out.entries, _copy_len_entries * sizeof(*state->orig.out.entries));
}
- memcpy(state->orig.out.entries, state->tmp.out.entries, (*state->tmp.out.num_ents) * sizeof(*state->orig.out.entries));
/* Copy result */
state->orig.out.result = state->tmp.out.result;
/* Return variables */
*_entry_handle = *r.out.entry_handle;
*_num_ents = *r.out.num_ents;
- if ((*r.out.num_ents) > (r.in.max_ents)) {
- return NT_STATUS_INVALID_NETWORK_RESPONSE;
+ {
+ size_t _copy_len_entries;
+ if ((*r.out.num_ents) > (r.in.max_ents)) {
+ return NT_STATUS_INVALID_NETWORK_RESPONSE;
+ }
+ _copy_len_entries = *r.out.num_ents;
+ memcpy(_entries, r.out.entries, _copy_len_entries * sizeof(*_entries));
}
- memcpy(_entries, r.out.entries, (*r.out.num_ents) * sizeof(*_entries));
/* Return result */
*result = r.out.result;
/* Copy out parameters */
*state->orig.out.entry_handle = *state->tmp.out.entry_handle;
*state->orig.out.num_towers = *state->tmp.out.num_towers;
- if ((*state->tmp.out.num_towers) > (state->tmp.in.max_towers)) {
- tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
- return;
+ {
+ size_t _copy_len_towers;
+ if ((*state->tmp.out.num_towers) > (state->tmp.in.max_towers)) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
+ return;
+ }
+ _copy_len_towers = *state->tmp.out.num_towers;
+ memcpy(state->orig.out.towers, state->tmp.out.towers, _copy_len_towers * sizeof(*state->orig.out.towers));
}
- memcpy(state->orig.out.towers, state->tmp.out.towers, (*state->tmp.out.num_towers) * sizeof(*state->orig.out.towers));
/* Copy result */
state->orig.out.result = state->tmp.out.result;
/* Return variables */
*_entry_handle = *r.out.entry_handle;
*_num_towers = *r.out.num_towers;
- if ((*r.out.num_towers) > (r.in.max_towers)) {
- return NT_STATUS_INVALID_NETWORK_RESPONSE;
+ {
+ size_t _copy_len_towers;
+ if ((*r.out.num_towers) > (r.in.max_towers)) {
+ return NT_STATUS_INVALID_NETWORK_RESPONSE;
+ }
+ _copy_len_towers = *r.out.num_towers;
+ memcpy(_towers, r.out.towers, _copy_len_towers * sizeof(*_towers));
}
- memcpy(_towers, r.out.towers, (*r.out.num_towers) * sizeof(*_towers));
/* Return result */
*result = r.out.result;